<template>
<!-- 应收明细 -->
<section class="content-box">
      <div>
      <div v-if="isshowList">
            <!--工具条-->
            <el-col :span="24" class="toolbar cover">
              <el-form class="title">
                <h2>历史工作台</h2>
                <el-form-item>
                  &nbsp;
                </el-form-item>
                <el-form-item>
                  <el-button size="small" @click="search" class="el-icon-search">&nbsp;查询</el-button>
                </el-form-item>
              </el-form>
            </el-col>
            <!-- <el-col :span="24" class="SuppC-toolbar">
              <el-form class="title">
                <div>
                  <h2>历史工作台</h2>
                </div>
                <el-form-item class="cover">
                  <div class="list-img" @click="search">
                    <img class="SuppC-common-icon" src="../../../static/content/images/Common/common-query.png" alt=""/>
                    <span>查询</span>
                  </div>
                </el-form-item>
              </el-form>
            </el-col> -->
            <!-- 列表 -->
            <!-- <el-table v-if="HistoryTableList" class="indexList" :data="HistoryTableList" highlight-current-row v-loading="loading" element-loading-text="正在加载中">
                  <el-table-column label="序号" type="index" width="100" sortable>
                  </el-table-column>
                  <el-table-column prop="DocType" label="业务类型">
                  </el-table-column>
                  <el-table-column prop="DocNO" label="单据编号">
                  </el-table-column>
                  <el-table-column prop="DocDate" label="单据日期" :formatter="formatDate" width="150">
                  </el-table-column>
                  <el-table-column prop="Title" label="标题" show-overflow-tooltip>
                  </el-table-column>
                  <el-table-column prop="DocStatus" label="单据状态">
                  </el-table-column>
                  <el-table-column prop="TotalMoney" label="金额">
                  </el-table-column>
                  <el-table-column prop="Voucher_DocNO" label="凭证编号">
                  </el-table-column>
                  <el-table-column label="操作" width="300">
                    <template slot-scope="scope">
                      <el-button-group>
                        <el-button v-if="scope.row.RecordType===0" size="small" @click="handleCheck(scope.$index, scope.row)">查看</el-button>                              
                        <el-button v-if="scope.row.RecordType!==0" size="small" @click.native="handleEdit(scope.$index, scope.row)">编辑</el-button>
                        <el-button v-if="scope.row.DocStatus==='待审核'"  size="small" @click="repeal(scope.$index, scope.row)">撤销</el-button>
                        <el-button v-if="scope.row.RecordType!==0" size="small" @click="checkflowRow(scope.$index, scope.row)">查看流程</el-button>
                        <el-button v-if="scope.row.RecordType!==0" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
                        <el-button size="small" v-if="scope.row.AttachmentCount>0" class="icon iconfont icon-attachment"></el-button>
                      </el-button-group>
                    </template>
			            </el-table-column>
            </el-table> -->
            <el-table v-if="HistoryTableList" class="indexList" :data="HistoryTableList" @row-dblclick="rowDblclickFn" @cell-mouse-enter="cellMouseEnterTwoFn" @cell-mouse-leave="cellMouseLeaveFn" highlight-current-row v-loading="loading" element-loading-text="正在加载中">
              <el-table-column prop="DocDate" label="日期" :formatter="formatDate">
              </el-table-column>
              <el-table-column prop="DocNO" label="单号">
              </el-table-column>
              <el-table-column prop="DocType" label="业务类型">
              </el-table-column>
              <el-table-column prop="TotalMoney" label="金额">
              </el-table-column>
              <el-table-column prop="Title" label="业务描述" min-width="150" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="Voucher_DocNO" label="凭证号">
              </el-table-column>
              <el-table-column prop="DocStatus" label="状态">
              </el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <!-- <el-button-group>
                    <el-button v-if="scope.row.RecordType===0" size="small" @click="handleCheck(scope.$index, scope.row)">查看</el-button>                              
                    <el-button v-if="scope.row.RecordType!==0" size="small" @click.native="handleEdit(scope.$index, scope.row)">编辑</el-button>
                    <el-button v-if="scope.row.DocStatus==='待审核'"  size="small" @click="repeal(scope.$index, scope.row)">撤销</el-button>
                    <el-button v-if="scope.row.RecordType!==0" size="small" @click="checkflowRow(scope.$index, scope.row)">查看流程</el-button>
                    <el-button v-if="scope.row.RecordType!==0" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
                    <el-button size="small" v-if="scope.row.AttachmentCount>0" class="icon iconfont icon-attachment"></el-button>
                  </el-button-group> -->
                  <div v-if="scope.row.DocNO==mouse_enter_Rcv_DocNO">
                  <!-- <div>  -->
                    <div  v-if="scope.row.DocStatus==='待审核'" class="list-img" @click.stop="repeal(scope.$index, scope.row)">
                      <!-- 撤销 -->
                      <img class="common-icon" src="../../../static/content/images/Common/common-repeal.png" alt=""/>
                    </div>
                    <div v-if="scope.row.DocStatus!=='新建'" class="list-img" @click.stop="checkflowRow(scope.$index, scope.row)">
                      <!-- 查看流程 -->
                      <img class="common-icon" src="../../../static/content/images/Common/common-flow.png" alt=""/>
                    </div>
                    <div v-if="scope.row.DocStatus=='新建'" class="list-img" @click.stop="handleDel(scope.$index, scope.row)">
                      <!-- 删除 -->
                      <img class="common-icon" src="../../../static/content/images/Common/common-list-dele.png" alt=""/>
                    </div>
                    <div  v-if="scope.row.AttachmentCount>0" class="list-img">
                      <!-- 附件 -->
                      <img class="common-icon" src="../../../static/content/images/Common/common-attach.png" alt=""/>
                    </div>
                  </div> 
                </template>
              </el-table-column>
            </el-table>

            <!--工具条-->
            <el-col :span="24" class="toolbar">
              <el-pagination @current-change="changePage" layout="prev, pager, next" :page-size="rows" :current-page="currentPage" :total="total" style="float:right;">
              </el-pagination>
            </el-col>

            <!--流程图-->
            <el-dialog title="流程执行情况" :visible.sync="checkflowRowVisible" :modal-append-to-body="false" align="center">
                  <el-table :data="docRowView" header-align="center" v-loading="docViewloading" element-loading-text="拼命刷新中...">
                    <el-table-column property="PlanUser" label="操作人"></el-table-column>
                    <el-table-column property="StepName" label="步骤名称"></el-table-column>
                    <el-table-column property="OpDate" label="时间"></el-table-column>
                    <el-table-column property="OpRemark" label="备注"></el-table-column>
                  </el-table>
            </el-dialog>
            <!--还款-->
            <el-dialog title="处理" :visible.sync="dialogRefundVisible" :modal-append-to-body="false" size="small">                                                
                        <h2 class="titles">《{{RefundMoneyObj.ER_Tite}}》收款
                          <el-button @click="getRefundHandlePrint" size="small" class="printClass">&nbsp;处理打印&nbsp;</el-button>                                                                                  
                          <el-button @click="getRefundPrint" size="small" class="printClass">&nbsp;流程打印&nbsp;</el-button> 
                        </h2>                                                  
                        <div class="rows">      
                            <span class="labels">类型：</span><el-input size="small" type="input" v-model="RefundMoneyObj.ER_Tite" auto-complete="off" class="wInput" :disabled="true"></el-input>
                            <span class="labels">制单日期：</span><el-date-picker size="small" type="date" v-model="RefundMoneyObj.dt[0].Repay_DocDate" placeholder="选择日期" class="wDate" :disabled="true"></el-date-picker>                                             
                        </div>
                        <div class="rows"> 
                            <span class="labels">单号：</span><el-input size="small" type="input" v-model="RefundMoneyObj.dt[0].Repay_DocNO" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                              
                            <span class="labels">收款方式：</span><el-select size="small" v-model="RefundMoneyObj.dt[0].Repay_RcvAccountItem" placeholder="请选择" class="wSelect" :disabled="true">
                                <el-option
                                  v-for="(item,index) in ReceivingTypeList"
                                  :key="index"
                                  :label="item.AccountItem_Name"
                                  :value="item.AccountItem_Code">
                                </el-option>
                            </el-select>
                        </div>
                        <div class="rows"> 
                            <span class="labels">状态：</span><el-input size="small" type="input" v-model="RefundMoneyObj.dt[0].DocStatus" auto-complete="off" class="wInput" :disabled="true"></el-input>
                            <span class="labels">申请人：</span><el-input size="small" type="input" v-model="RefundMoneyObj.dt[0].UserName" auto-complete="off" class="wInput" :disabled="true"></el-input>
                        </div>
                        <div class="rows"> 
                            <span class="labels">现金流量类型：</span><el-select size="small" v-model="RefundMoneyObj.dt[0].Repay_CashFlowItem" placeholder="请选择" class="wSelect" :disabled="true">
                                <el-option
                                  v-for="(item,index) in CashFlowList"
                                  :key="index"
                                  :label="item.CashFlowItem_Name"
                                  :value="item.CashFlowItem_Code">
                                </el-option>
                            </el-select>
                            <span class="labels">申请部门：</span><el-input size="small" v-model="RefundMoneyObj.dt[0].Dept_Name" auto-complete="off" class="wInput" :disabled="true"></el-input>
                        </div>
                        <div class="rows"> 
                            <span class="labels">现金期间：</span><el-select size="small" v-model="RefundMoneyObj.dt[0].Repay_CashPeriod" placeholder="请选择" class="wSelect"  :disabled="true">
                                <el-option
                                  v-for="(item,index) in PeriodList"
                                  :key="index"
                                  :label="item.Period_Name"
                                  :value="item.Period_Code">
                                </el-option>
                            </el-select>                                                   
                            <span class="labels">标题：</span><el-input size="small" v-model="RefundMoneyObj.dt[0].Repay_Title" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                     
                        </div>
                        <div class="rows"> 
                            <span class="labels">还款金额合计：</span><el-input size="small" v-model="RefundMoneyObj.dt[0].Repayment" auto-complete="off" class="wInput" :disabled="true"></el-input>               
                            <span class="labels">权责期间：</span><el-input size="small" v-model="RefundMoneyObj.dt[0].Repay_AccountPeriod" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                     
                        </div>
                        <div slot="footer" class="dialog-footer">
                            <el-button @click="cancel">取 消</el-button>
                        </div>
                </el-dialog>
                <!--借款-->
                <el-dialog title="处理" :visible.sync="dialogBusinessVisible" :modal-append-to-body="false" size="small">                                      
                            <h2 class="titles">《{{BusinessObj.ER_Tite}}》付款
                              <el-button @click="getBorrowHandlePrint" size="small" class="printClass">&nbsp;处理打印&nbsp;</el-button>                                                        
                              <el-button @click="getBorrowPrint" size="small" class="printClass">&nbsp;流程打印&nbsp;</el-button>
                            </h2>                                           
                            <div class="rows">                               
                                <span class="labels">单据日期：</span><el-date-picker type="date" v-model="BusinessObj.dt[0].Borrow_DocDate" placeholder="选择日期" class="wDate"  :disabled="true"></el-date-picker>
                                <span class="labels">业务类型：</span><el-input type="input" v-model="BusinessObj.dt[0].BusinessTypeName" auto-complete="off" class="wInput" :disabled="true"></el-input>
                            </div>              
                            <div class="rows">   
                                <span class="labels">供应商名称：</span><el-input type="input" v-model="BusinessObj.dt[0].Name" auto-complete="off" class="wInput" :disabled="true"></el-input>
                                <span class="labels">借款金额合计：</span><el-input type="input" v-model="BusinessObj.dt[0].Borrow_TotalBorrowMoney" auto-complete="off" class="wInput" :disabled="true"></el-input>
                            </div>                             
                            <div class="rows">   
                                <span class="labels">付款方式</span><el-select v-model="BusinessObj.dt[0].Borrow_PayAccountItem" placeholder="请选择" class="wSelect" :disabled="true">
                                    <el-option
                                        v-for="(item,index) in ReceivingTypeList"
                                        :key="index"
                                        :label="item.AccountItem_Name"
                                        :value="item.AccountItem_Code">
                                    </el-option>
                                </el-select>
                                <span class="labels">收款银行</span><el-select v-model="BusinessObj.dt[0].Borrow_RcvBank" placeholder="请选择" class="wSelect"  :disabled="true">
                                    <el-option
                                        v-for="(item,index) in bankList"
                                        :key="index"
                                        :label="item.Bank"
                                        :value="item.Code">
                                    </el-option>
                                </el-select>
                            </div>
                            <div class="rows">   
                                <span class="labels">银行账号：</span><el-input type="input" v-model="BusinessObj.dt[0].Borrow_RcvBankAccount" auto-complete="off" class="wInput" :disabled="true"></el-input>
                                <span class="labels">现金期间：</span><el-select v-model="BusinessObj.dt[0].Borrow_CashPeriod" placeholder="请选择" class="wSelect"  :disabled="true">
                                    <el-option
                                        v-for="(item,index) in PeriodList"
                                        :key="index"
                                        :label="item.Period_Name"
                                        :value="item.Period_Code">
                                    </el-option>
                                </el-select>
                            </div>
                            <div class="rows">   
                                <span class="labels">类型：</span><el-input type="input" v-model="BusinessObj.ER_Tite" auto-complete="off" class="wInput" :disabled="true"></el-input>
                                <span class="labels">用途：</span><el-input type="input" v-model="BusinessObj.dt[0].Borrow_Title" auto-complete="off" class="wInput" :disabled="true"></el-input>
                            </div>
                            <div class="rows">
                                <span class="labels">单号：</span><el-input type="input" v-model="BusinessObj.dt[0].Borrow_DocNO" placeholder="选择日期" class="wDate"  :disabled="true"></el-input>
                                <span class="labels">状态：</span><el-input type="input" v-model="BusinessObj.dt[0].DocStatus"  class="wInput"  :disabled="true"></el-input>
                            </div>
                            <div class="rows">  
                                <span class="labels">权责期间：</span><el-input type="input" v-model="BusinessObj.dt[0].Borrow_AccountPeriod"  class="wInput"  :disabled="true"></el-input>
                                <span class="labels">申请人：</span><el-input type="input" v-model="BusinessObj.dt[0].UserName" class="wDate"  :disabled="true"></el-input>                                
                            </div>
                            <div class="rows"> 
                                <span class="labels">申请部门：</span><el-input type="input" v-model="BusinessObj.dt[0].Dept_Name"  class="wInput"  :disabled="true"></el-input>
                                <span class="labels">现金流量类型：</span><el-select v-model="BusinessObj.dt[0].Borrow_CashFlowItem" placeholder="请选择" class="wSelect" :disabled="true">
                                <el-option
                                  v-for="(item,index) in CashFlowList"
                                  :key="index"
                                  :label="item.CashFlowItem_Name"
                                  :value="item.CashFlowItem_Code">
                                </el-option>
                                </el-select>
                            </div>
                            <div class="rows">
                                <span class="labels">标题：</span><el-input type="input" v-model="BusinessObj.dt[0].Borrow_Title"  class="wInput"  :disabled="true"></el-input>
                            </div>
                            <div slot="footer" class="dialog-footer">
                              <el-button @click="cancel">取 消</el-button>
                            </div>
                    </el-dialog>
                    <!--报销-->
                    <el-dialog title="处理" :visible.sync="dialogExpenseVisible" :modal-append-to-body="false" size="small">                                                
                        <h2 class="titles">《{{ExpenseObj.ER_Tite}}》付款
                          <el-button @click="getExpenseHandlePrint" size="small" class="printClass">&nbsp;处理打印&nbsp;</el-button>                          
                          <el-button @click="getExpensePrint" size="small" class="printClass">&nbsp;流程打印&nbsp;</el-button>
                        </h2>
                        <div class="rows">      
                            <span class="labels">单据日期：</span><el-date-picker size="small" type="date" v-model="ExpenseObj.dt[0].Expense_DocDate" placeholder="选择日期" class="wDate"  :disabled="true"></el-date-picker>                                             
                            <span class="labels">业务类型：</span><el-input size="small" type="input" v-model="ExpenseObj.dt[0].BusinessTypeName" auto-complete="off" class="wInput" :disabled="true"></el-input>                         
                        </div>
                        <div class="rows"> 
                            <span class="labels">供应商：</span><el-input size="small" type="input" v-model="ExpenseObj.dt[0].Name" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                              
                            <span class="labels">本次报销金额：</span><el-input size="small" type="input" v-model="ExpenseObj.dt[0].Expense_TotalRequestMoney" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                              
                        </div>
                        <div class="rows"> 
                            <span class="labels">本次核销借款：</span><el-input size="small" type="input" v-model="ExpenseObj.dt[0].Repayment" auto-complete="off" class="wInput" :disabled="true"></el-input>
                            <span class="labels">本次付款金额：</span><el-input size="small" type="input" v-model="ExpenseObj.dt[0].Payment" auto-complete="off" class="wInput" :disabled="true"></el-input>
                        </div>
                        <div class="rows"> 
                            <span class="labels">付款方式：</span><el-select size="small" v-model="ExpenseObj.dt[0].Expense_PayAccountItem" placeholder="请选择" class="wSelect"  :disabled="true">
                                <el-option
                                    v-for="(item,index) in ReceivingTypeList"
                                    :key="index"
                                    :label="item.AccountItem_Name"
                                    :value="item.AccountItem_Code">
                                </el-option>
                            </el-select>
                            <span class="labels">收款银行：</span><el-select size="small" v-model="ExpenseObj.dt[0].bank" placeholder="请选择" class="wSelect"  :disabled="true">
                                <el-option
                                    v-for="(item,index) in bankList"
                                    :key="index"
                                    :label="item.Bank"
                                    :value="item.Code">
                                </el-option>
                            </el-select>
                        </div>
                        <div class="rows">                                       
                            <span class="labels">银行账号：</span><el-input size="small" v-model="ExpenseObj.dt[0].Expense_RcvBankAccount" auto-complete="off" class="wInput" :disabled="true"></el-input>
                            <span class="labels">现金期间：</span><el-select size="small" v-model="ExpenseObj.dt[0].Expense_CashPeriod" placeholder="请选择" class="wSelect"  :disabled="true">
                                <el-option
                                    v-for="(item,index) in PeriodList"
                                    :key="index"
                                    :label="item.Period_Name"
                                    :value="item.Period_Code">
                                </el-option>
                            </el-select>
                        </div>
                        <div class="rows">                                                    
                            <span class="labels">类型：</span><el-input size="small" v-model="ExpenseObj.ER_Tite" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                     
                            <span class="labels">用途：</span><el-input size="small" v-model="ExpenseObj.dt[0].Expense_Title" auto-complete="off" class="wInput" :disabled="true"></el-input>               
                        </div>
                        <div class="rows"> 
                            <span class="labels">单号：</span><el-input size="small" v-model="ExpenseObj.dt[0].Expense_DocNO" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                     
                            <span class="labels">状态：</span><el-input size="small" v-model="ExpenseObj.dt[0].DocStatus" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                 
                        </div>
                        <div class="rows"> 
                            <span class="labels">权责期间：</span><el-input size="small" v-model="ExpenseObj.dt[0].Expense_AccountPeriod" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                     
                            <span class="labels">申请人：</span><el-input size="small" v-model="ExpenseObj.dt[0].UserName" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                 
                        </div>
                        <div class="rows">
                            <span class="labels">现金流量类型：</span><el-select v-model="ExpenseObj.dt[0].Expense_CashFlowItem" placeholder="请选择" class="wSelect"  :disabled="true">
                            <el-option
                                v-for="(item,index) in CashFlowList"
                                :key="index"
                                :label="item.CashFlowItem_Name"
                                :value="item.CashFlowItem_Code">
                                </el-option>
                            </el-select>   
                            <span class="labels">申请部门：</span><el-input size="small" v-model="ExpenseObj.dt[0].Dept_Name" auto-complete="off" class="wInput" :disabled="true"></el-input>                                                                                      
                        </div>
                        <div class="rows">
                            <span class="labels">标题</span><el-input size="small" v-model="ExpenseObj.dt[0].Expense_Title" auto-complete="off" class="wInput" :disabled="true"></el-input>                            
                        </div>
                        <div slot="footer" class="dialog-footer">
                            <el-button @click="cancel">取 消</el-button>
                        </div>
                    </el-dialog>
                </div>
    <div v-if="isshowEditRcv">
      <!-- 导航条 -->
			<div class="flex-top">
				<div>
					<i class="el-icon-arrow-left back" @click="editToRcvBack"></i>
					<span style="font-size:20px;vertical-align:middle;margin:0 10px;">
						出纳收款单</span>
					<!-- <small>
						<span>状态：</span>
						<el-tag type="success">{{Type==0?"新建":Type==1?"修改":Type==2?"查看":Type==3?"待审核":''}}</el-tag>
					</small> -->
				</div>
        <!-- 右侧 -->
				<div class="flex">
					<span class="wrapper cover">
            <el-button-group>
              <el-button size="small" @click="openUploadDialog" :disabled="fjBtnDisabled">
                <i class="icon iconfont icon-shangchuan"></i>&nbsp;附件
              </el-button>
              <el-button size="small" v-if="Type!==0" @click="Communication" :disabled="communicateButtonDisabled">
                <i class="icon iconfont icon-chat-with-doctor"></i>&nbsp;沟通
              </el-button>
              <el-button size="small" v-if="Type===2||Type===3" @click="checkflow">
                <i class="icon iconfont icon-liucheng"></i>&nbsp;流程
              </el-button>
              <el-button size="small" v-if="Type===3" @click="RcvReject">
                <i class="icon iconfont icon-bohui"></i>&nbsp;驳回
              </el-button>
              <el-button size="small" @click="editRcvSave" v-if="Type===0||Type===1" :disabled="Type===2||Type===3">
                <i class="icon iconfont icon-baocun"></i>&nbsp;保存
              </el-button>
              <el-button size="small" @click="editRcvSubmit" v-if="Type===0||Type===1" :disabled="Type===2||Type===3">
                <i class="icon iconfont icon-tijiao"></i>&nbsp;提交
              </el-button>
              <el-button size="small" @click="getPrint" v-if="Type===2">
                <i class="icon iconfont icon-yy"></i>&nbsp;打印
              </el-button>
              <el-button size="small" v-if="Type===3" @click="RcvAudit">
                <i class="icon iconfont icon-shenhe"></i>&nbsp;同意
              </el-button>
            </el-button-group>
          </span>
				</div>
      </div>
      <!-- 中部 -->
      <div class="flex-content">
        <main class="main">
          <div class="main-left">
            <div>
              <h3>单号:</h3>
              <strong>{{DocNo}}</strong>
            </div>
            <div>
              <h3>日期：</h3>
              <div class="flex">
                <el-date-picker  :disabled="Type===2||Type===3" type="date" v-model="docDate" placeholder="选择日期">
                </el-date-picker>
              </div>
            </div>
            <div>
              <h3>收款金额：</h3>
              <div class="flex">
                <!-- <input type="text" :disabled="Type===2||Type===3" class='applied' v-model="CollectionMoney"> -->
                <el-input type="text" :disabled="Type===2||Type===3" @blur="doToFixedFn('CollectionMoney')" @keyup.native="onlyNumBasicFn('CollectionMoney')" v-model="CollectionMoney"></el-input>
              </div>
            </div>
          </div>
          <div class="main-right">
            <!-- <div class="left-form">
              <el-row>
                <el-col :span="12">
                  <span class="rvc">现金期间</span>
                  <el-select  :disabled="Type===2||Type===3" v-model="period"  placeholder="请选择" filterable>
                    <el-option
                      v-for="(item,index) in PeriodList"
                      :key="index"
                      :label="item.Period_Name"
                      :value="item.Period_Code">
                    </el-option>
                  </el-select>
                </el-col>
                <el-col :span="12">
                  <span class="rvc">客户</span>
                  <el-select  
                  :disabled="Type===2||Type===3" 
                  v-model="custom"  
                  placeholder="请输入关键字" 
                  :remote-method="remoteMethod"
                  remote
                  filterable
                  clearable
                  @change="changeCustom(custom)">
                    <el-option 
                      v-for="item in Customer" 
                      :key="item.Code" 
                      :value='item.Code' 
                      :label="item.Name">
                    </el-option>
                  </el-select>
                </el-col>
                <el-col :span="12">
                  <span class="rvc">收款方式</span>
                  <el-select  :disabled="Type===2||Type===3" v-model="receivingType"  placeholder="请选择" filterable>
                    <el-option v-for="(item,index) in ReceivingTypeList" 
                    :key="index" 
                    :value="item.AccountItem_Code" 
                    :label="item.AccountItem_Name">
                    </el-option>
                  </el-select>
                </el-col>
                <el-col :span="12">
                  <span class="rvc">收款金额</span>
                  <input type="text" :disabled="Type===2||Type===3" class='applied' v-model="CollectionMoney">
                </el-col>
              </el-row>
            </div>
            <div class="right-form">
              <span>业务描述</span><br><br>
              <el-input
                :disabled="Type===2||Type===3"
                type="textarea"
                :rows="10"
                placeholder="请输入内容"
                v-model="describe">
              </el-input>
            </div> -->
            <div class="line-heigth-80" style="width: 100%;">
              <el-row>
                <el-col :span="12">
                  <div>
                    <span class="rvc">客&emsp;&emsp;户</span>
                    <el-select
                    class="margin-left-20"  
                    :disabled="Type===2||Type===3" 
                    v-model="custom"  
                    placeholder="请输入关键字" 
                    :remote-method="remoteMethod"
                    remote
                    filterable
                    clearable
                    @change="changeCustom(custom)">
                      <el-option 
                        v-for="item in Customer" 
                        :key="item.AI_Code" 
                        :value='item.AI_Code' 
                        :label="item.AI_Name">
                      </el-option>
                    </el-select>                  
                  </div>
                  <div>
                    <span class="rvc">现金期间</span>
                    <el-select class="margin-left-20"  :disabled="Type===2||Type===3" v-model="period"  placeholder="请选择" filterable>
                      <el-option
                        v-for="(item,index) in PeriodList"
                        :key="index"
                        :label="item.Period_Name"
                        :value="item.Period_Code">
                      </el-option>
                    </el-select>
                  </div>
                  <div>
                    <span class="rvc">收款方式</span>
                    <el-select class="margin-left-20"  :disabled="Type===2||Type===3" v-model="receivingType"  placeholder="请选择" filterable>
                      <el-option v-for="(item,index) in ReceivingTypeList" 
                      :key="index" 
                      :value="item.AccountItem_Code" 
                      :label="item.AccountItem_Name">
                      </el-option>
                    </el-select>                
                  </div>                
                </el-col>
                <el-col :span="12">
                  <div>
                    <span>业务描述</span>
                    <el-input
                      class="input-resize-none"
                      :disabled="Type===2||Type===3"
                      type="textarea"
                      :rows="3"
                      placeholder="请输入内容"
                      v-model="describe">
                    </el-input>                
                  </div>                
                </el-col>
              </el-row>
            </div>
            <div class="right-form"></div>
          </div>
        </main>
        <!--底部-->
        <div class="budget-two">
          <div class="nav">
            <!-- <el-checkbox v-model="isSwitch" @change="showChange()" :disabled="Type===2||Type===3">是否预收款</el-checkbox> -->
            <div v-if="isShowPayment">
              <!-- <el-button class="add-button" size="small" @click="getPaymentAddDiaLog" :disabled="Type===2||Type===3">选择收入确认</el-button>&#12288; -->
              <!-- <template v-if="Count1>0">合计：<span class="Count">{{Count1}}</span></template> -->
              <el-dialog title="选择收入确认" :visible.sync="dialogPayVisible" @close="doCloseFn" :modal-append-to-body="false" align="center" size="small">
                <el-table :data="paymentsTemp"  highlight-current-row max-height="300" border class="th-text-center">
                  <el-table-column label="单号">
                    <template slot-scope="scope">
                    {{ scope.row.Income_DocNo }}
                    </template>
                  </el-table-column>
                  <el-table-column label="金额">
                    <template slot-scope="scope">
                    {{ scope.row.Income_TotalIncomeMoney==0 ? '' : scope.row.Income_TotalIncomeMoney}}
                    </template>
                  </el-table-column>
                  <el-table-column label="未收款金额">
                    <template slot-scope="scope">
                    {{ scope.row.Surplus==0 ? '' : scope.row.Surplus}}
                    </template>
                  </el-table-column>
                  <el-table-column label="本次收款金额">
                    <template slot-scope="scope">
                      <div class="full-box">
                        <el-input :autofocus="true" type="text"  v-model="scope.row.Money" @blur="doToFixed(scope,'row','Money')" @keyup.native="onlyNumObjFn(scope,'row','Money')" :placeholder="'请输入金额'">
                        </el-input>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column label="摘要">
                    <template slot-scope="scope">
                    {{ scope.row.Income_Title }}
                    </template>
                  </el-table-column>
                </el-table>
                <span slot="footer" class="dialog-footer">
                  <el-button @click="doCloseFn">取 消</el-button>
                  <el-button type="primary" @click="confirm">确 定</el-button>
                </span>
              </el-dialog>
              <div class="nav">
                <span><i class="icon iconfont icon-iconfontcolor52"></i> 收款明细</span>
              </div>
              <el-table v-if="paymentsPrint" :data="paymentsPrint" @cell-mouse-enter="cellMouseEnterFn" @cell-mouse-leave="cellMouseLeaveFn" :empty-text="'点击--添加收款明细'" @click.native="(Type==2||Type==3)?'':getPaymentAddDiaLog()" border style="width: 100%;" highlight-current-row max-height="300" class="th-text-center">
                  <el-table-column label="操作" width="80">
                    <template slot-scope="scope">
                      <div class="text-align-center" v-if="scope.row.Rcv_DocNO==mouse_enter_Rcv_DocNO" v-show="Type!==2&&Type!==3">
                        <button size="small" @click.stop="changeMoneyToZero(scope)" class="oper-btn"><img class="common-icon" src="/static/content/images/Common/common-dele.png"/></button>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column label="单号" width="120">
                    <template slot-scope="scope">
                    {{ scope.row.Income_DocNo }}
                    </template>
                  </el-table-column>
                  <el-table-column label="金额" width="120">
                    <template slot-scope="scope">
                    {{ scope.row.Income_TotalIncomeMoney==0 ? '' : scope.row.Income_TotalIncomeMoney}}
                    </template>
                  </el-table-column>
                  <el-table-column label="未收款金额" width="120">
                    <template slot-scope="scope">
                    {{ scope.row.Surplus==0 ? '' : scope.row.Surplus}}
                    </template>
                  </el-table-column>
                  <el-table-column label="本次收款金额" width="150">
                      <template slot-scope="scope">
                      {{ scope.row.Money==0 ? '' : scope.row.Money}}
                      </template>
                  </el-table-column>
                  <el-table-column label="摘要">
                      <template slot-scope="scope">
                      {{ scope.row.Income_Title }}
                      </template>
                  </el-table-column>
              </el-table>
              <div class="clearfloat">
                <div class="total-box">合计：<span class="Count-text">{{Count1}}</span></div>
              </div>   
            </div>
          </div>
          <div v-if="isAdvanceDetails" class="padding-size-10">
            <!-- <div style="margin-left:10px;" class="cover">     
              <el-button size="small" @click="addlist" style="margin-left:10px;">添加预算明细</el-button>
            </div> -->
            <div class="nav">
              <span><i class="icon iconfont icon-iconfontcolor52"></i> 收款明细</span>
            </div>            
            <table class="cusTable" border="1" width="100%">
              <!-- <tr>
                <th>金额</th>
                <th>部门</th>
                <th>收入类型</th>
                <th>操作</th>
              </tr> -->
              <tr>
                <th>操作</th>
                <th>部门</th>
                <th>收入类型</th>
                <th>金额</th>
              </tr>              
              <tr v-for="(i,index) in detail" :key="index" class="cusTable-tr">
                <!-- 遍历初始化的detail添加行空数据 -->
                <td width="10%">
                  <!-- <el-button size="small" @click="handleDelete(index)" type="danger" class="dele">删除</el-button> -->
                  <div class="oper-btn-wrapper" v-if="!(Type==2||Type==3)">
                    <button size="small" @click="handleDelete(index)" class="oper-btn"><img class="common-icon" src="/static/content/images/Common/common-dele.png"/></button>
                    <button size="small" @click="addlist" class="oper-btn"><img class="common-icon" src="/static/content/images/Common/common-add.png"/></button>
                  </div>
                </td>
                <td width="35%">      
                  <el-select :disabled="Type===2 || Type===3" class="formVal full-box" v-model="i.Department">
                    <!-- v-model => 部门 -->
                    <el-option v-for="(item,index) in baseDeptList" :value="item.CODE" :key="index" :label="item.FULLNAME">
                    </el-option>
                  </el-select>
                </td>
                <td width="35%">
                  <el-select :disabled="Type===2 || Type===3" class="formVal full-box" v-model="i.BudgetItem">   
                    <!-- v-model => 类型 -->
                    <el-option v-for="(item,index) in budgetItemList" :value="item.BudgetItem_Code" :key="index" :label="item.BudgetItem_FullName">
                    </el-option>
                  </el-select>
                </td>
                <td>
                  <el-input :disabled="Type===2 || Type===3" type="text" v-model="i.IncomeMoney" class="formval-money full-box" @blur="doToFixed(i,'IncomeMoney')" @keyup.native="onlyNumObjFn(i,'IncomeMoney')" @keydown.enter.native="addlist" :placeholder="'请输入金额'"></el-input>
                  <!-- v-model => 金额 -->
                </td>
              </tr>
            </table>         
            <div class="clearfloat">
              <div class="total-box">合计：<span class="Count-text">{{Count3}}</span></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div v-if="isshowEditPay">
      <!--导航条-->
      <div class="flex-top">
        <div>
					<i class="el-icon-arrow-left back" @click="editToPayBack"></i>
					<span style="font-size:20px;vertical-align:middle;margin:0 10px;">
						出纳付款单</span>
					<!-- <small>
						<span>状态：</span>
						<el-tag type="success">{{Type==0?"新建":Type==1?"修改":Type==2?"查看":Type==3?"待审核":''}}</el-tag>
					</small> -->
				</div>
        <!-- 右侧 -->
				<div class="flex">
					<span class="wrapper cover">
            <el-button-group>
              <el-button size="small" @click="openUploadDialog" :disabled="fjBtnDisabled">
                <i class="icon iconfont icon-shangchuan"></i>&nbsp;附件
              </el-button>
              <el-button size="small" v-if="Type!==0" @click="Communication" :disabled="communicateButtonDisabled">
                <i class="icon iconfont icon-chat-with-doctor"></i>&nbsp;沟通
              </el-button>
              <el-button size="small" v-if="Type===2||Type===3" @click="checkflow">
                <i class="icon iconfont icon-liucheng"></i>&nbsp;流程
              </el-button>
              <el-button size="small" v-if="Type===3" @click="PayReject">
                <i class="icon iconfont icon-bohui"></i>&nbsp;驳回
              </el-button>
              <el-button size="small" @click="editPaySave" v-if="Type===0||Type===1" :disabled="Type===2||Type===3">
                <i class="icon iconfont icon-baocun"></i>&nbsp;保存
              </el-button>
              <el-button size="small" @click="editPaySubmit" v-if="Type===0||Type===1" :disabled="Type===2||Type===3">
                <i class="icon iconfont icon-tijiao"></i>&nbsp;提交
              </el-button>
              <el-button size="small" @click="getPrint" v-if="Type===2">
                <i class="icon iconfont icon-yy"></i>&nbsp;打印
              </el-button>
              <el-button size="small" v-if="Type===3" @click="PayAudit">
                <i class="icon iconfont icon-shenhe"></i>&nbsp;同意
              </el-button>
            </el-button-group>
					</span>
				</div>
      </div>
      <!-- 中部 -->
      <div class="flex-content">
        <main class="main">
          <div class="main-left">
            <div>
              <h3>单号:</h3>
              <strong>{{DocNo}}</strong>
            </div>
            <div>
              <h3>日期：</h3>
              <div class="flex">
                <el-date-picker :disabled="Type===2||Type===3" type="date"  v-model="docDate" placeholder="选择日期">
                </el-date-picker>
              </div>
            </div>
            <div>
              <h3>申请金额：</h3>
              <div class="flex">
                <!-- <input :disabled="Type===2||Type===3" type="text" class='applied' v-model="applyMoney"> -->
                <el-input :disabled="Type===2||Type===3" type="text" @blur="doToFixedFn('applyMoney')" @keyup.native="onlyNumBasicFn('applyMoney')" v-model="applyMoney"></el-input>
              </div>            
            </div>
          </div>
          <div class="main-right">
            <!-- <div class="left-form">
                <el-row>
                  <el-col :span="12">
                  <span class="pay">收款对方</span>
                    <el-select :disabled="Type===2||Type===3"  v-model="supplier"  placeholder="请选择" filterable  @change="choiceSupplie(supplier)">
                      <el-option
                        v-for="(item,index) in SupplierList"
                        :key="index"
                        :label="item.Name"
                        :value="item.Code">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                  <span class="pay">开户银行</span>
                    <el-select :disabled="Type===2||Type===3"  v-model="bank"  placeholder="请选择" filterable>
                      <el-option 
                        v-for="(item,index) in bankList" 
                        :key="index" 
                        :value="item.Code"
                        :label="item.Bank">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">现金流量类型</span>
                    <el-select :disabled="Type===2||Type===3" v-model="cashFlow"  placeholder="请选择" filterable>
                      <el-option v-for="(item,index) in CashFlowList" 
                      :key="index" 
                      :value="item.CashFlowItem_Code" 
                      :label="item.CashFlowItem_Name">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">付款方式</span>
                    <el-select :disabled="Type===2||Type===3" v-model="receivingType"  placeholder="请选择" filterable>
                      <el-option v-for="(item,index) in ReceivingTypeList" 
                      :key="index" 
                      :value="item.AccountItem_Code" 
                      :label="item.AccountItem_Name">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">现金期间</span>
                    <el-select :disabled="Type===2||Type===3" v-model="period"  placeholder="请选择" filterable>
                      <el-option v-for="(item,index) in PeriodList" 
                      :key="index" 
                      :value="item.Period_Code" 
                      :label="item.Period_Name">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12" style="position:relative">
                    <span class="pay">银行账号</span>
                    <el-tag v-if="bankAccount" type="primary" class="bankNum">{{bankAccount}}</el-tag>              
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">申请金额</span>
                    <input :disabled="Type===2||Type===3" type="text" class='applied' v-model="applyMoney">
                  </el-col>
                </el-row>
            </div> -->
            <div class="left-form" style="line-height: 60px !important;">
                <el-row>
                  <el-col :span="12">
                    <span class="pay">收款对方</span>
                    <el-select :disabled="Type===2||Type===3"  v-model="supplier"  placeholder="请选择" filterable  @change="choiceSupplie(supplier)">
                      <el-option
                        v-for="(item,index) in SupplierList"
                        :key="index"
                        :label="item.Name"
                        :value="item.Code">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">开户银行</span>
                    <el-select :disabled="Type===2||Type===3"  v-model="bank"  placeholder="请选择" filterable>
                      <el-option 
                        v-for="(item,index) in bankList" 
                        :key="index" 
                        :value="item.Code"
                        :label="item.Bank">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">现金流量</span>
                    <el-select :disabled="Type===2||Type===3" v-model="cashFlow"  placeholder="请选择" filterable>
                      <el-option v-for="(item,index) in CashFlowList" 
                      :key="index" 
                      :value="item.CashFlowItem_Code" 
                      :label="item.CashFlowItem_Name">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">付款方式</span>
                    <el-select :disabled="Type===2||Type===3" v-model="receivingType"  placeholder="请选择" filterable>
                      <el-option v-for="(item,index) in ReceivingTypeList" 
                      :key="index" 
                      :value="item.AccountItem_Code" 
                      :label="item.AccountItem_Name">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12">
                    <span class="pay">现金期间</span>
                    <el-select :disabled="Type===2||Type===3" class="ele-select" v-model="period"  placeholder="请选择" filterable>
                      <el-option v-for="(item,index) in PeriodList" 
                      :key="index" 
                      :value="item.Period_Code" 
                      :label="item.Period_Name">
                      </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="12" style="position:relative">
                    <span class="pay">银行账号</span>
                    <!-- <el-tag v-if="bankAccount" type="primary" class="bankNum">{{bankAccount}}</el-tag>-->
                    <span v-if="bankAccount" type="primary" class="bankNum">
                      {{bankAccount}}
                    </span>                    
                  </el-col>
                  <!-- <el-col :span="24">
                    <span class="pay">申请金额</span>
                    <input type="text" class='applied' v-model="applyMoney">
                  </el-col> -->
                  <el-col :span="24">
                    <span class="pay">业务描述</span>
                    <div style="display: inline-block;width: 75%;">
                      <el-input
                        :disabled="Type===2||Type===3" 
                        type="textarea"
                        :rows="2"
                        placeholder="请输入内容"
                        v-model="describe">
                      </el-input>
                    </div>                  
                  </el-col>
                </el-row>
            </div>
            <div class="right-form">
              <!-- <span>业务描述</span><br><br>
              <el-input
                :disabled="Type===2||Type===3" 
                type="textarea"
                :rows="10"
                placeholder="请输入内容"
                v-model="describe">
              </el-input> -->
            </div>
          </div>
        </main>
        <!--底部-->
        <div class="budget-two">
          <div class="padding-size-10">
            <div class="nav">
              <span><i class="icon iconfont icon-iconfontcolor52"></i> 预算明细</span>&#x3000;
              <!-- <template v-if="Count2>0">合计：<span class="Count">{{Count2}}</span></template>
              <el-button class="add-button" size="small" @click="addBudgetlist">添加行</el-button> -->
            </div>
            <table class="cusTable" border="1" width="100%">
              <tr><!-- <th>金额</th>
                <th>对方科目</th>
                <th>辅助核算项目</th>
                <th>操作</th> --> 
                <th>操作</th>
                <th>对方科目</th>
                <th>辅助核算项目</th>
                <th>金额</th>
              </tr>
              <tr v-for="(i,index) in budgetList" :key="index" class="cusTable-tr">
                <td width="10%">
                  <!-- <el-button size="small" @click="PayDelete(index)" type="danger" class="dele" :disabled="Type===2||Type===3">删除</el-button> -->
                  <div class="oper-btn-wrapper" v-if="!(Type===2||Type===3)">
                    <button size="small" @click="PayDelete(index)" class="oper-btn"><img class="common-icon" src="/static/content/images/Common/common-dele.png"/></button>
                    <button size="small" @click="addBudgetlist" class="oper-btn"><img class="common-icon" src="/static/content/images/Common/common-add.png"/></button>
                  </div>
                </td>
                <td width="35%">
                  <!-- 对方科目 -->
                  <el-select class="formVal full-box" style="width:90%" filterable v-model="i.accountItem" @visible-change="changeAccountItem(index,i.accountItem, $event)" :disabled="Type===2||Type===3">       
                    <el-option v-for="(item,index) in AccountItemList" :value="item.AccountItem_Code" :key="index" :label="item.AccountItem_FullName">
                    </el-option>
                  </el-select>    
                </td>
                <td width="35%">
                  <!-- 辅助核算项目 -->
                  <div class="name-wrapper">
                    <el-tag type="danger" v-if='i.name'>{{i.name}}</el-tag>
                  </div>
                  <div class="assistItem-wrapper">
                    <el-select class="formVal full-box" filterable v-model="i.assistItem" :disabled="Type===2||Type===3">       
                      <el-option v-for="(item,index) in AssistItemList[index]" :value="item.AI_Code" :key="index" :label="item.AI_Name">
                      </el-option>
                    </el-select>
                  </div>
                </td>
                <td>
                  <!-- <el-input type="number" v-model.number="i.Money" class="formval-money full-box"  :disabled="Type===2||Type===3"></el-input> -->
                  <el-input type="text" :disabled="Type===2||Type===3" v-model="i.Money"  @blur="doToFixed(i,'Money')" @keyup.native="onlyNumObjFn(i,'Money')" @keydown.enter.native="addBudgetlist" class="formval-money full-box" placeholder="请输入金额"></el-input>
                </td>
              </tr>
            </table>
            <div class="clearfloat">
              <div class="total-box">合计：<span class="Count-text">{{Count2}}</span></div>
            </div>
          </div>
        </div>
      </div>
    </div>
      <!-- 沟通 -->
      <!-- <el-dialog
        :visible.sync="dialogCommunicationVisible"
        :modal-append-to-body="false"
        size="tiny">
        <ul class="Communication" ref="content">
          <li v-for="(item,index) in CommunicationContentList" :key="index">
            <el-row>
              <el-col :span="2">
                <a href="javascript:;"><img :src="item.Img" alt="" class="round"/></a>
              </el-col>
              <el-col :span="22">              
                <div class="message1">
                  <p class="name"><el-tag type="success">{{item.CreateByName}}</el-tag></p>       
                  <p class="content">{{item.CC_Content}}</p>
                  <p class="date"><el-tag type="primary">{{item.SysCreateDate}}</el-tag></p>
                </div>
              </el-col>
            </el-row>
          </li>
          <li v-if="this.CommunicationContentList.length==0"><p class="not-communication"><i class="el-icon-warning"></i>未有沟通</p></li>
        </ul>
        <el-row v-if="this.communiTypes===3" style="line-height:70px;">
          <el-col :span="17">
            <el-select v-model="launch" multiple filterable="" allow-create placeholder="请选择沟通对象" style="width:80%;">
              <el-option v-for="(item,index) in LaunchList" :key="index" :label="item.RealName" :value="item.Id">
              </el-option>
            </el-select>
          </el-col>
          <el-col :span="2">
            <el-checkbox v-model="launchChecked" @change="launchChange(launchChecked)">允许提交者编辑单据</el-checkbox>
          </el-col>
        </el-row>
        <el-row v-if="(this.communiTypes!==0 && this.communiTypes!==2) || this.isshowLauch==true" style="line-height:70px;">
          <el-col :span="21">
            <el-input v-model="contentInput" placeholder="请输入内容"></el-input>
          </el-col>
          <el-col :span="2">          
            <el-button style="margin-left:10px;" type="primary" @click="CommunicationDetermine">发送</el-button>
          </el-col>          
        </el-row>
      </el-dialog> -->
      <!-- 沟通改版 -->
      <el-dialog
        class="el-dialog__body-padding"
        :visible.sync="dialogCommunicationVisible"
        :modal-append-to-body="false"
        size="tiny"
        style="line-height: normal;">
        <p v-if="CommunicationContentList.length!==0" class="title">沟通内容:</p>
        <ul v-if="CommunicationContentList.length!==0" class="Communication-Two mt-15 mb-15" ref="content">
          <li v-for="(item,index) in CommunicationContentList" :key="index" :class="index!==CommunicationContentList.length-1?'mb-10':''">
            <el-row>
              <el-col :span="4" class="Communication-left">
                <a href="javascript:;"><img :src="item.Img" alt="" class="round"/></a>
                <p class="name" style="color: #13ce66;">{{item.CreateByName}}</p>
              </el-col>
              <el-col :span="20" style="height: 78px;">              
                <div class="message1">      
                  <p class="content">{{item.CC_Content}}</p>
                  <p class="date"><el-tag type="primary">{{item.SysCreateDate}}</el-tag></p>
                </div>
              </el-col>
            </el-row>
          </li>
          <!-- <li v-if="this.CommunicationContentList.length==0"><p class="not-communication"><i class="el-icon-warning"></i>未有沟通</p></li> -->
        </ul>
        <p v-if="communiTypes===3" class="title">发起沟通:</p>
        <el-row v-if="communiTypes===3" class="padding-top-15">
          <el-col :span="17">
            <el-select v-model="launch" multiple filterable="" allow-create placeholder="请选择沟通对象" style="width:80%;">
              <el-option v-for="(item,index) in LaunchList" :key="index" :label="item.RealName" :value="item.Id">
              </el-option>
            </el-select>
          </el-col>
          <el-col :span="2">
            <el-checkbox v-model="launchChecked" @change="launchChange(launchChecked)">允许提交者编辑单据</el-checkbox>
          </el-col>
        </el-row>
        <!-- <el-row v-if="(this.communiTypes!==0 && this.communiTypes!==2) || this.isshowLauch==true">
          <el-col :span="21">
            <el-input v-model="contentInput" placeholder="请输入内容"></el-input>
          </el-col>
          <el-col :span="2">          
            <el-button style="margin-left:10px;" type="primary" @click="CommunicationDetermine">发送</el-button>
          </el-col>          
        </el-row> -->
        <!-- <p v-if="(this.communiTypes!==0 && this.communiTypes!==2) || this.isshowLauch==true" v-show="this.CommunicationContentList.length!==0" class="title padding-top-15">回复沟通:</p> -->
        <div v-if="(this.communiTypes!==0 && this.communiTypes!==2) || this.isshowLauch==true" v-show="this.CommunicationContentList.length!==0">
          <p v-if="this.communiTypes!==3" class="title padding-top-15">回复沟通:</p>
        </div>
        <el-row v-if="(this.communiTypes!==0 && this.communiTypes!==2) || this.isshowLauch==true" class="padding-top-15">
          <el-col :span="24">
            <el-input v-model="contentInput" type="textarea" :rows="3" placeholder="请输入内容"></el-input>
          </el-col>     
        </el-row>
        <el-row v-if="(this.communiTypes!==0 && this.communiTypes!==2) || this.isshowLauch==true" class="padding-top-15">
          <el-col :span="24">          
            <el-button style="float: right;" type="primary" @click="CommunicationDetermine">发送</el-button>
          </el-col>          
        </el-row>
      </el-dialog> 
      <!--流程图-->
			<el-dialog title="流程执行情况" :visible.sync="checkflowVisible" :modal-append-to-body="false" align="center">
				<el-table :data="docView" header-align="center" v-loading="docViewloading" element-loading-text="拼命刷新中...">
					<el-table-column property="PlanUser" label="操作人"></el-table-column>
					<el-table-column property="StepName" label="步骤名称"></el-table-column>
					<el-table-column property="OpDate" label="时间"></el-table-column>
					<el-table-column property="OpRemark" label="备注"></el-table-column>
				</el-table>
			</el-dialog>
      <!--附件-->
      <el-dialog title="附件" :visible.sync="dialogUploadVisible" :modal-append-to-body="false" >
        <label for="file" v-if="Type!=2&&Type!=3" class="label-file"><i class="icon iconfont icon-shangchuan">&nbsp;</i>上传</label>
        <input name="file" id="file" type="file" accept="*" @change="update" multiple/>
        <div><br></div>
        <ul ref="images" style="display:none">
          <li v-for="(item, index) in UploadList" :key="index">
            <!-- <img :src="`http://192.168.1.188:8011/${item.Attachment_Url}`" :alt="item.Attachment_FileName"> -->
            <img :src="item.Attachment_Url" :alt="item.Attachment_FileName">    
          </li>
        </ul>
        <el-table :data="UploadList" header-align="center" id="test">
          <el-table-column property="ID" label="ID" width="100"></el-table-column>
          <el-table-column property="Attachment_UploadDate" label="日期" :formatter="formatUploadDate"></el-table-column>
          <el-table-column property="Attachment_FileName" label="名称" show-overflow-tooltip></el-table-column>          
          <el-table-column label="操作" max-width="100">
            <template slot-scope="scope">
              <div style="display:inline-block;">
                <el-button v-if='isShowPreview(scope.row.Attachment_FileName)' type="info" size="small" @click="preview(scope)">
                  &#12288;<i class="el-icon-search"></i>预览&#12288;
                </el-button>
              </div>
              <a class="down" :href="scope.row.Attachment_Url" :download='scope.row.Attachment_FileName'>下载</a>
              <el-button type="danger" v-if="Type!=2&&Type!=3" size="small" @click="DeleUpload(scope.$index, scope.row)">&#12288;删除&#12288;</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-dialog>
      <!--收款单流程打印窗口-->
      <el-dialog title="打印" :visible.sync="dialogRcvPrintVisible" :modal-append-to-body="false">
          <div class="printBox cover">
            <el-button size="small" class="center" @click.native="printRcvPdf()">&#12288;打印&#12288;</el-button>
            <div id="formRcv">
              <table width="100%" border="0" v-loading="PrintLoading" element-loading-text="正在加载中">
              <caption>
                <h3 id="Doc">{{printsData.ER_Tite || ''}}</h3>
              </caption>
              <thead>
                <tr>
                  <td style="padding:15px 10px;line-height:30px;">
                    <div id="CompanyName" style="float:left">{{printsData.CompanyName || ''}}</div>
                    <div id="Current" style="float:right">打印日期：{{printsData.Current || ''}}</div>
                  </td>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>
                    <div id="div" class="table-c">
                      <table cellpadding="3" width="100%" class="ListTable">
                        <tbody>
                          <tr>
                            <td class="tbTitle">单号</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Rcv_DocNO : '' }}</td>
                            <td class="tbTitle">申请人</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.CreateByName : ''}}</td>
                            <td class="tbTitle">申请部门</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.CreateByDeptName : ''}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">单据日期</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Pay_DocDateStr : ''}}</td>
                            <td class="tbTitle">收款方式</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Rcv_RcvAccountItemName : ''}}</td>
                            <td class="tbTitle">收款金额</td>
                            <td class="Tabletd">
                              {{printsData.entity && printsData.entity.Rcv_TotalRcvMoney ? printsData.entity.Rcv_TotalRcvMoney.toFixed(2):'0.00'}}
                            </td>
                          </tr>
                          <tr>
                            <td class="tbTitle">客户</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Rcv_PayCustomerName : ''}}</td>
                            <td class="tbTitle">业务描述</td>
                            <td class="Tabletd" colspan="3">{{printsData.entity ? printsData.entity.Rcv_Title :''}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr v-if="printsData.entity && printsData.entity.PayLineSet && printsData.entity.PayLineSet.length>0">
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr v-if="printsData.entity && printsData.entity.PayLineSet && printsData.entity.PayLineSet.length>0">
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>单号</td>
                            <td>摘要</td>
                            <td>金额</td>
                            <td>未收款金额</td>
                            <td>本次收款金额</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.entity.PayLineSet" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.RcvLine_Income ? p.RcvLine_Income : ''}}</td>
                            <td>{{p.Income_Title ? p.Income_Title : ''}}</td>
                            <td>{{p && p.Income_TotalIncomeMoney ? p.Income_TotalIncomeMoney.toFixed(2) : ''}}</td>
                            <td>{{p && p.RcvLine_CurrentLeaveMoney ? p.RcvLine_CurrentLeaveMoney.toFixed(2) :''}}</td>
                            <td>{{p && p.RcvLine_RcvMoney ? p.RcvLine_RcvMoney.toFixed(2) :''}}</td>
                          </tr>
                          <tr>
                            <td colspan="5">合计</td>
                            <td>{{printsData.entity && printsData.entity.PayLineSetMoney ? printsData.entity.PayLineSetMoney.toFixed(2):'0.00'}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr>
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>处理人</td>
                            <td>处理结果</td>
                            <td>备注</td>
                            <td>处理日期</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.Chart" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.PlanUser ? p.PlanUser : ''}}</td>
                            <td>{{p.StepName ? p.StepName : ''}}</td>
                            <td>{{p.OpRemark ? p.OpRemark : ''}}</td>
                            <td>{{p.OpDate ? p.OpDate : ''}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <!--审批流-->
                  <td>
                    <div id="Chart" class="table-c"></div>
                  </td>
                </tr>
              </tbody>
            </table>
            </div>
          </div>
      </el-dialog>
      <!--付款单流程打印窗口-->
      <el-dialog title="打印" :visible.sync="dialogPayPrintVisible" :modal-append-to-body="false">
          <div class="printBox cover">
            <el-button size="small" class="center" @click.native="printPayPdf()">&#12288;打印&#12288;</el-button>
            <div id="formPay">
              <table width="100%" border="0" v-loading="PrintLoading" element-loading-text="正在加载中">
              <caption>
                <h3 id="Doc">{{printsData.ER_Tite || ''}}</h3>
              </caption>
              <thead>
                <tr>
                  <td style="padding:15px 10px;line-height:30px;">
                    <div id="CompanyName" style="float:left">{{printsData.CompanyName || ''}}</div>
                    <div id="Current" style="float:right">打印日期：{{printsData.Current || ''}}</div>
                  </td>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>
                    <div id="div" class="table-c">
                      <table cellpadding="3" width="100%" class="ListTable">
                        <tbody>
                          <tr>
                            <td class="tbTitle">单号</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Pay_DocNO : '' }}</td>
                            <td class="tbTitle">申请人</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.CreateByName : ''}}</td>
                            <td class="tbTitle">申请部门</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.CreateByDeptName : ''}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">单据日期</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Pay_DocDateStr : ''}}</td>
                            <td class="tbTitle">状态</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Pay_DocStatusName : ''}}</td>
                            <td class="tbTitle">供应商</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Pay_SupplierName : ''}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">付款金额</td>
                            <td class="Tabletd">{{printsData.entity && printsData.entity.Pay_TotalPayMoney ? printsData.entity.Pay_TotalPayMoney.toFixed(2) : ''}}</td>
                            <td class="tbTitle">开户银行</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Pay_RcvBank : ''}}</td>
                            <td class="tbTitle">银行账号</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Pay_RcvBankAccount : ''}}</td>
                          </tr>

                          <tr>
                            <td class="tbTitle">业务描述</td>
                            <td class="Tabletd" colspan="5">{{printsData.entity ? printsData.entity.Pay_Title :''}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr>
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>对方科目</td>
                            <td>备注</td>
                            <td>金额</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.entity.PayLineSet" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.PayLine_OtherAccountItemName ? p.PayLine_OtherAccountItemName : ''}}</td>
                            <td>{{p.PayLine_Remark ? p.PayLine_Remark : ''}}</td>
                            <td>{{p && p.PayLine_PayMoney ? p.PayLine_PayMoney.toFixed(2) : ''}}</td>
                          </tr>
                          <tr>
                            <td colspan="3">合计</td>
                            <td>{{printsData.entity && printsData.entity.PayLineSetMoney ? printsData.entity.PayLineSetMoney.toFixed(2):'0.00'}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr>
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>处理人</td>
                            <td>处理结果</td>
                            <td>备注</td>
                            <td>处理日期</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.Chart" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.PlanUser ? p.PlanUser : ''}}</td>
                            <td>{{p.StepName ? p.StepName : ''}}</td>
                            <td>{{p.OpRemark ? p.OpRemark : ''}}</td>
                            <td>{{p.OpDate ? p.OpDate : ''}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <!--审批流-->
                  <td>
                    <div id="Chart" class="table-c"></div>
                  </td>
                </tr>
              </tbody>
            </table>
            </div>
          </div>
      </el-dialog>
      <!--借款单处理打印窗口-->
      <el-dialog :visible.sync="BorrowPrintHandleVisible" :modal-append-to-body="false">
				<div class="printBox cover">
					<el-button size="small" class="center" @click.native="printBorrowPdf2()">&#12288;打印&#12288;</el-button>
					<div id="formBorrow2">
            <table width="100%" border="0">
              <caption>
                <h3 id="Doc">{{BusinessObj.ER_Tite || ''}}</h3>
              </caption>
              <tbody>
                <tr>
                  <td>
                    <div id="div" class="table-c">
                      <table cellpadding="3" width="100%" class="ListTable">
                        <tbody>
                          <tr>
                            <td class="tbTitle">单据日期：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_DocDate}}</td>
                            <td class="tbTitle">业务类型：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].BusinessTypeName}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">供应商名称：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Name}}</td>
                            <td class="tbTitle">借款金额合计：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_TotalBorrowMoney}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">付款方式：</td>
                            <td class="Tabletd">{{PayAccountItemString(BusinessObj.dt[0].Borrow_PayAccountItem)}}</td>
                            <td class="tbTitle">收款银行：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_RcvBank}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">银行账号：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_RcvBankAccount}}</td>
                            <td class="tbTitle">现金期间：</td>
                            <td class="Tabletd">{{PeriodString(BusinessObj.dt[0].Borrow_CashPeriod)}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">类型：</td>
                            <td class="Tabletd">{{BusinessObj.ER_Tite}}</td>
                            <td class="tbTitle">用途：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_Title}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">单号：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_DocNO}}</td>
                            <td class="tbTitle">状态：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].DocStatus}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">权责期间：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_AccountPeriod}}</td>
                            <td class="tbTitle">申请人：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].UserName}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">申请部门：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Dept_Name}}</td>
                            <td class="tbTitle">现金流量类型：</td>
                            <td class="Tabletd">{{CashFlowItemString(BusinessObj.dt[0].Borrow_CashFlowItem)}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">标题：</td>
                            <td class="Tabletd">{{BusinessObj.dt[0].Borrow_Title}}</td>
                            <td class="tbTitle"></td>
                            <td class="Tabletd"></td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
				</div>
      </el-dialog>
      <!--借款单流程打印窗口-->
			<el-dialog :visible.sync="BorrowPrintVisible" :modal-append-to-body="false">
				<div class="printBox cover">
					<el-button size="small" class="center" @click.native="printBorrowPdf()">&#12288;打印&#12288;</el-button>
					<div id="formBorrow">
            <table width="100%" border="0" v-loading="PrintLoading" element-loading-text="正在加载中">
              <caption>
                <h3 id="Doc">{{printsData.ER_Tite || ''}}</h3>
              </caption>
              <thead>
                <tr>
                  <td style="padding:15px 10px;line-height:30px;">
                    <div id="CompanyName" style="float:left">{{printsData.CompanyName || ''}}</div>
                    <div id="Current" style="float:right">打印日期：{{printsData.Current || ''}}</div>
                  </td>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>
                    <div id="div" class="table-c">
                      <table cellpadding="3" width="100%" class="ListTable">
                        <tbody>
                          <tr>
                            <td class="tbTitle">单号</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.DocNo : '' }}</td>
                            <td class="tbTitle">申请人</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.CreateByName : ''}}</td>
                            <td class="tbTitle">申请部门</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.RequestDeptName : ''}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">单据日期</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.DocDateStr : ''}}</td>
                            <td class="tbTitle">业务类型</td>
                            <td class="Tabletd">{{printsData.entity.BusinessType==2?'对私':'对公'}}</td>
                            <td class="tbTitle">供应商</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.SupplierName : ''}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">借款金额</td>
                            <td class="Tabletd">{{printsData.entity && printsData.entity.TotalBorrowMoney ? printsData.entity.TotalBorrowMoney.toFixed(2) : '0.00'}}</td>
                            <td class="tbTitle">开户银行</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.RcvBank : ''}}</td>
                            <td class="tbTitle">银行账号</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.RcvBankAccount : ''}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">业务描述</td>
                            <td colspan="5" class="Tabletd">
                              {{printsData.entity ? printsData.entity.Title : ''}}
                            </td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr>
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>预算树</td>
                            <td>预算组织</td>
                            <td>预算科目</td>
                            <td>借款金额</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.entity.BorrowLineSet" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.YBDEntity.YearBudgetName ? p.YBDEntity.YearBudgetName : ''}}</td>
                            <td>{{p.YBDEntity.DepartmentName ? p.YBDEntity.DepartmentName : ''}}</td>
                            <td>{{p.YBDEntity.BudgetItemName ? p.YBDEntity.BudgetItemName : ''}}</td>
                            <td>{{p && p.BorrowMoney ? p.BorrowMoney.toFixed(2) : ''}}</td>
                          </tr>
                          <tr>
                            <td colspan="4">合计</td>
                            <td>{{printsData.entity && printsData.entity.BorrowLineSetMoney ? printsData.entity.BorrowLineSetMoney.toFixed(2):'0.00'}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr>
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>处理人</td>
                            <td>处理结果</td>
                            <td>备注</td>
                            <td>处理日期</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.Chart" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.PlanUser ? p.PlanUser : ''}}</td>
                            <td>{{p.StepName ? p.StepName : ''}}</td>
                            <td>{{p.OpRemark ? p.OpRemark : ''}}</td>
                            <td>{{p.OpDate ? p.OpDate : ''}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <!--审批流-->
                  <td>
                    <div id="Chart" class="table-c"></div>
                  </td>
                </tr>
              </tbody>
            </table>
					</div>
				</div>
			</el-dialog>
      <!--报销单流程打印窗口-->
      <el-dialog :visible.sync="ExpensePrintVisible" :modal-append-to-body="false">
          <div class="printBox cover">
            <el-button size="small" class="center" @click.native="printExpensePdf()">&#12288;打印&#12288;</el-button>
            <div id="formExpense">
              <table width="100%" border="0" v-loading="PrintLoading" element-loading-text="正在加载中">
                <caption>
                  <h3 id="Doc">{{printsData.ER_Tite || ''}}</h3>
                </caption>
                <thead>
                  <tr>
                    <td style="padding:15px 10px;line-height:30px;">
                      <div id="CompanyName" style="float:left">{{printsData.CompanyName || ''}}</div>
                      <div id="Current" style="float:right">打印日期：{{printsData.Current || ''}}</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <div id="div" class="table-c">
                        <table cellpadding="3" width="100%" class="ListTable">
                          <tbody>
                            <tr>
                              <td class="tbTitle">单号</td>
                              <td class="Tabletd">{{printsData.entity ? printsData.entity.DocNo : '' }}</td>
                              <td class="tbTitle">申请人</td>
                              <td class="Tabletd">{{printsData.entity ? printsData.entity.RequestEmpName : ''}}</td>
                              <td class="tbTitle">申请部门</td>
                              <td class="Tabletd">{{printsData.entity ? printsData.entity.RequestDeptName : ''}}</td>
                            </tr>
                            <tr>
                              <td class="tbTitle">单据日期</td>
                              <td class="Tabletd">{{printsData.entity ? printsData.entity.DocDateStr : ''}}</td>
                              <td class="tbTitle">业务类型</td>
                              <td class="Tabletd">{{printsData.entity.BusinessType==2?'对私':'对公'}}</td>
                              <td class="tbTitle">供应商</td>
                              <td class="Tabletd">{{printsData.entity ? printsData.entity.SupplierName : ''}}</td>
                            </tr>
                            <tr>
                              <td class="tbTitle">申请金额</td>
                              <td class="Tabletd">{{printsData.entity && printsData.entity.TotalRequestMoney ? printsData.entity.TotalRequestMoney.toFixed(2) : '0.00'}}</td>
                              <td class="tbTitle">本次付款金额</td>
                              <td class="Tabletd">{{printsData.entity && printsData.entity.TotalLeaveMoney ? printsData.entity.TotalLeaveMoney.toFixed(2) : '0.00'}}</td>
                              <td class="tbTitle">开户银行</td>
                              <td class="Tabletd">{{printsData.entity ? printsData.entity.RcvBank : ''}}</td>
                            </tr>
                            <tr>
                              <td class="tbTitle">银行账号</td>
                              <td class="Tabletd">
                                {{printsData.entity ? printsData.entity.RcvBankAccount:''}}
                              </td>
                              <td class="tbTitle">业务描述</td>
                              <td colspan="3" class="Tabletd">
                                {{printsData.entity ? printsData.entity.Title : ''}}
                              </td>                 
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </td>
                  </tr>
                  <tr v-if="printsData.entity && printsData.entity.ExpenseBorrowLineSet && printsData.entity.ExpenseBorrowLineSet.length>0">
                    <td style="line-height:30px;">&nbsp;</td>
                  </tr>
                  <tr v-if="printsData.entity && printsData.entity.ExpenseBorrowLineSet && printsData.entity.ExpenseBorrowLineSet.length>0">                   
                    <td>
                      <div id="Line" class="table-c">
                        <table width="100%" class="ListTable">
                          <thead>
                            <tr>
                              <td width="5%">NO</td>
                              <td>借款单号</td>
                              <td>借款金额</td>
                              <td>未核销金额</td>
                              <td>本次核销金额</td>
                            </tr>
                          </thead>
                          <tbody>
                            <tr v-for="(p,index) in printsData.entity.ExpenseBorrowLineSet" :key="index">
                              <td>{{index+1}}</td>
                              <td>{{p.BorrowDoc ? p.BorrowDoc : ''}}</td>
                              <td>{{p && p.TotalBorrowMoney ? p.TotalBorrowMoney.toFixed(2) : ''}}</td>
                              <td>{{p && p.CurrentLeaveMoney ? p.CurrentLeaveMoney.toFixed(2) :''}}</td>
                              <td>{{p && p.WriteOffMoney ? p.WriteOffMoney.toFixed(2) :''}}</td>
                            </tr>
                            <tr>
                              <td colspan="4">合计</td>
                              <td>{{printsData.entity && printsData.entity.ExpenseBorrowLineSetMoney ? printsData.entity.ExpenseBorrowLineSetMoney.toFixed(2):'0.00'}}</td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="line-height:30px;">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>
                      <div id="Line" class="table-c">
                        <table width="100%" class="ListTable">
                          <thead>
                            <tr>
                              <td width="5%">NO</td>
                              <td>预算树</td>
                              <td>预算组织</td>
                              <td>预算科目</td>
                              <td>借款金额</td>
                            </tr>
                          </thead>
                          <tbody>
                            <tr v-for="(p,index) in printsData.entity.ExpenseLineSet" :key="index">
                              <td>{{index+1}}</td>
                              <td>{{p.YBDEntity.YearBudgetName ? p.YBDEntity.YearBudgetName : ''}}</td>
                              <td>{{p.YBDEntity.DepartmentName ? p.YBDEntity.DepartmentName : ''}}</td>
                              <td>{{p.YBDEntity.BudgetItemName ? p.YBDEntity.BudgetItemName : ''}}</td>
                              <td>{{p && p.RequestMoney ? p.RequestMoney.toFixed(2) : ''}}</td>
                            </tr>
                            <tr>
                              <td colspan="4">合计</td>
                              <td>{{printsData.entity && printsData.entity.ExpenseLineSetMoney ? printsData.entity.ExpenseLineSetMoney.toFixed(2):'0.00'}}</td>                    
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </td>
                  </tr>
                  <tr v-if="printsData.entity && printsData.entity.ExpenseTradeLineSet && printsData.entity.ExpenseTradeLineSet.length>0"><td style="line-height:30px;">&nbsp;</td></tr>
                  <tr v-if="printsData.entity && printsData.entity.ExpenseTradeLineSet && printsData.entity.ExpenseTradeLineSet.length>0">     
                  <td>
                      <div id="Line" class="table-c">
                        <table width="100%" class="ListTable">
                          <thead>
                            <tr>
                              <td width="5%">NO</td>
                              <td>挂账科目</td>
                              <td>往来单位</td>
                              <td>挂账金额</td>
                            </tr>
                          </thead>
                          <tbody>
                            <tr v-for="(p,index) in printsData.entity.ExpenseTradeLineSet" :key="index">
                              <td>{{index+1}}</td>
                              <td>{{p.AccountItemName ? p.AccountItemName : ''}}</td>
                              <td>{{p.AssistItemName ? p.AssistItemName : ''}}</td>
                              <td>{{p && p.TradeMoney ? p.TradeMoney.toFixed(2) : ''}}</td>
                            </tr>
                            <tr>
                              <td colspan="3">合计</td>
                              <td>{{printsData.entity && printsData.entity.ExpenseTradeLineSetMoney ? printsData.entity.ExpenseTradeLineSetMoney.toFixed(2):'0.00'}}</td>          
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td style="line-height:30px;">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>
                      <div id="Line" class="table-c">
                        <table width="100%" class="ListTable">
                          <thead>
                            <tr>
                              <td width="5%">NO</td>
                              <td>处理人</td>
                              <td>处理结果</td>
                              <td>备注</td>
                              <td>处理日期</td>
                            </tr>
                          </thead>
                          <tbody>
                            <tr v-for="(p,index) in printsData.Chart" :key="index">
                              <td>{{index+1}}</td>
                              <td>{{p.PlanUser ? p.PlanUser : ''}}</td>
                              <td>{{p.StepName ? p.StepName : ''}}</td>
                              <td>{{p.OpRemark ? p.OpRemark : ''}}</td>
                              <td>{{p.OpDate ? p.OpDate : ''}}</td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <!--审批流-->
                    <td>
                      <div id="Chart" class="table-c"></div>
                    </td>
                  </tr>
                </tbody>
              </table>
          </div>
        </div>
      </el-dialog>
      <!--报销单处理打印窗口-->
      <el-dialog :visible.sync="ExpensePrintHandleVisible" :modal-append-to-body="false">
        <div class="printBox cover">
          <el-button class="center" size="small" @click="printExpensePdf2()">&#12288;打印&#12288;</el-button>
          <div id="formExpense2">
            <table width="100%" border="0">
              <caption>
                <h3 id="Doc">{{ExpenseObj.ER_Tite || ''}}</h3>
              </caption>
              <tbody>
                <tr>
                  <td>
                    <div id="div" class="table-c">
                      <table cellpadding="3" width="100%" class="ListTable">
                        <tbody>
                          <tr>
                            <td class="tdTitle">单据日期</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_DocDate}}</td>
                            <td class="tdTitle">业务类型</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].BusinessTypeName}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">供应商</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Name}}</td>
                            <td class="tdTitle">本次报销金额</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_TotalRequestMoney}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">本次核销借款</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Repayment}}</td>
                            <td class="tdTitle">本次付款金额</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Payment}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">付款方式</td>
                            <td class="Tabletd">{{PayAccountItemString(ExpenseObj.dt[0].Expense_PayAccountItem)}}</td>
                            <td class="tdTitle">收款银行</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_RcvBank}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">银行账号</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_RcvBankAccount}}</td>
                            <td class="tdTitle">现金期间</td>
                            <td class="Tabletd">{{PeriodString(ExpenseObj.dt[0].Expense_CashPeriod)}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">类型</td>
                            <td class="Tabletd">{{ExpenseObj.ER_Tite}}</td>
                            <td class="tdTitle">用途</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_Title}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">单号</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_DocNO}}</td>
                            <td class="tdTitle">状态</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].DocStatus}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">权责期间</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_AccountPeriod}}</td>
                            <td class="tdTitle">申请人</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].UserName}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">现金流量类型</td>
                            <td class="Tabletd">{{CashFlowItemString(ExpenseObj.dt[0].Expense_CashFlowItem)}}</td>
                            <td class="tdTitle">申请部门</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Dept_Name}}</td>
                          </tr>
                          <tr>
                            <td class="tdTitle">标题</td>
                            <td class="Tabletd">{{ExpenseObj.dt[0].Expense_Title}}</td>
                            <td class="tdTitle"></td>
                            <td class="Tabletd"></td>
                          </tr>
                        </tbody>
                      </table>          
                    </div>                  
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </el-dialog>
      <!--还款单处理打印-->
      <el-dialog :visible.sync="RefundPrintHandleVisible" :modal-append-to-body="false">
          <div class="printBox cover">
            <el-button size="small" class="center" @click.native="printRefundPdf2()">&#12288;打印&#12288;</el-button>
            <div id="formRefund2">
              <table width="100%" border="0">
              <caption>
                <h3 id="Doc">{{RefundMoneyObj.ER_Tite || ''}}</h3>
              </caption>
              <tbody>
                <tr>
                  <td>
                    <div id="div" class="table-c">
                      <table cellpadding="3" width="100%" class="ListTable">
                        <tbody>
                          <tr>
                            <td class="tbTitle">类型</td>
                            <td class="Tabletd">{{RefundMoneyObj.ER_Tite}}</td>
                            <td class="tbTitle">制单日期</td>
                            <td class="Tabletd">{{formatTime(RefundMoneyObj.dt[0].Repay_DocDate)}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">单号</td>
                            <td class="Tabletd">{{RefundMoneyObj.dt[0].Repay_DocNO}}</td>
                            <td class="tbTitle">收款方式</td>
                            <td class="Tabletd">{{PayAccountItemString(RefundMoneyObj.dt[0].Repay_RcvAccountItem)}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">状态</td>
                            <td class="Tabletd">{{RefundMoneyObj.dt[0].DocStatus}}</td>
                            <td class="tbTitle">申请人</td>
                            <td class="Tabletd">{{RefundMoneyObj.dt[0].UserName}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">现金流量类型</td>
                            <td class="Tabletd">{{CashFlowItemString(RefundMoneyObj.dt[0].Repay_CashFlowItem)}}</td>
                            <td class="tbTitle">申请部门</td>
                            <td class="Tabletd">{{RefundMoneyObj.dt[0].Dept_Name}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">现金期间</td>
                            <td class="Tabletd">{{PeriodString(RefundMoneyObj.dt[0].Repay_CashPeriod)}}</td>
                            <td class="tbTitle">标题</td>
                            <td class="Tabletd">{{RefundMoneyObj.dt[0].Repay_Title}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">还款金额合计</td>
                            <td class="Tabletd">{{RefundMoneyObj.dt[0].Repayment}}</td>
                            <td class="tbTitle">权责期间</td>
                            <td class="Tabletd">{{RefundMoneyObj.dt[0].Repay_AccountPeriod}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
              </tbody>
              </table>
            </div>
          </div>
      </el-dialog>
      <!--还款单流程打印窗口-->
      <el-dialog :visible.sync="RefundPrintVisible" :modal-append-to-body="false">
          <div class="printBox cover">
            <el-button size="small" class="center" @click.native="printRefundPdf()">&#12288;打印&#12288;</el-button>
            <div id="formRefund">
              <table width="100%" border="0" v-loading="PrintLoading" element-loading-text="正在加载中">
              <caption>
                <h3 id="Doc">{{printsData.ER_Tite || ''}}</h3>
              </caption>
              <thead>
                <tr>
                  <td style="padding:15px 10px;line-height:30px;">
                    <div id="CompanyName" style="float:left">{{printsData.CompanyName || ''}}</div>
                    <div id="Current" style="float:right">打印日期：{{printsData.Current || ''}}</div>
                  </td>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>
                    <div id="div" class="table-c">
                      <table cellpadding="3" width="100%" class="ListTable">
                        <tbody>
                          <tr>
                            <td class="tbTitle">单号</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.DocNo : '' }}</td>
                            <td class="tbTitle">申请人</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.CreateByName : ''}}</td>
                            <td class="tbTitle">申请部门</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.CreateByDeptName : ''}}</td>
                          </tr>
                          <tr>
                            <td class="tbTitle">单据日期</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.DocDateStr : ''}}</td>
                            <td class="tbTitle">还款金额</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.TotalRepayMoney : ''}}</td>
                            <td class="tbTitle">业务描述</td>
                            <td class="Tabletd">{{printsData.entity ? printsData.entity.Title : ''}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr>
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>借款单号</td>
                            <td>借款日期</td>
                            <td>借款金额</td>
                            <td>欠款金额</td>
                            <td>本次还款金额</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.entity.RepayLineSet" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.BorrowDocNo ? p.BorrowDocNo : ''}}</td>
                            <td>{{p.BorrowDocDate ? p.BorrowDocDate : ''}}</td>
                            <td>{{p.TotalBorrowMoney && p.TotalBorrowMoney ? p.TotalBorrowMoney.toFixed(2) :''}}</td>
                            <td>{{p.CurrentLeaveMoney && p.CurrentLeaveMoney ? p.CurrentLeaveMoney.toFixed(2) :''}}</td>
                            <td>{{p.RepayMoney && p.RepayMoney ? p.RepayMoney.toFixed(2) :''}}</td>                            
                          </tr>
                          <tr>
                            <td colspan="5">合计</td>
                            <td>{{printsData.entity && printsData.entity.RepayLineSetMoney ? printsData.entity.RepayLineSetMoney.toFixed(2):'0.00'}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td style="line-height:30px;">&nbsp;</td>
                </tr>
                <tr>
                  <td>
                    <div id="Line" class="table-c">
                      <table width="100%" class="ListTable">
                        <thead>
                          <tr>
                            <td width="5%">NO</td>
                            <td>处理人</td>
                            <td>处理结果</td>
                            <td>备注</td>
                            <td>处理日期</td>
                          </tr>
                        </thead>
                        <tbody>
                          <tr v-for="(p,index) in printsData.Chart" :key="index">
                            <td>{{index+1}}</td>
                            <td>{{p.PlanUser ? p.PlanUser : ''}}</td>
                            <td>{{p.StepName ? p.StepName : ''}}</td>
                            <td>{{p.OpRemark ? p.OpRemark : ''}}</td>
                            <td>{{p.OpDate ? p.OpDate : ''}}</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <!--审批流-->
                  <td>
                    <div id="Chart" class="table-c"></div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </el-dialog>
      <!--查询-->
      <el-dialog title="查询" :visible.sync="dialogSearchVisible" :modal-append-to-body="false" size="tiny">
        <el-form :model="Searchform">
          <el-form-item label="金  额 ：" :label-width="formLabelWidth">
            <el-input v-model.number.trim="Searchform.StartMoney" auto-complete="off" style="width:120px;"></el-input>
            至&nbsp;<el-input v-model.number.trim="Searchform.EndMoney" auto-complete="off" style="width:120px;"></el-input>
          </el-form-item>
          <el-form-item label="日  期 ：" :label-width="formLabelWidth">
            <el-date-picker type="date" v-model="Searchform.StartDate" style="width:120px;" placeholder="选择日期"></el-date-picker>
            至&nbsp;<el-date-picker type="date" v-model="Searchform.EndDate" style="width:120px;" placeholder="选择日期"></el-date-picker>
          </el-form-item>
          <el-form-item label="业务类型 ：" :label-width="formLabelWidth">
            <el-select v-model="Searchform.Type" style="width:262px;" placeholder="请选择">
              <el-option value="" label="全部">全部</el-option>
              <el-option
                v-for="item in TypeOptions"
                :key="item.Code"
                :label="item.Name"
                :value="item.Code">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="单  号 ：" :label-width="formLabelWidth">
            <el-input v-model="Searchform.DocNo" style="width:262px;"></el-input>
          </el-form-item>
          <el-form-item label="标  题 ：" :label-width="formLabelWidth">
            <el-input v-model="Searchform.Title" style="width:262px;"></el-input>
          </el-form-item>
          <el-form-item label="凭证编号 ：" :label-width="formLabelWidth">
            <el-input v-model="Searchform.VoucherNO" style="width:262px;"></el-input>
          </el-form-item>
          <el-form-item label="状 态 ：" :label-width="formLabelWidth">
            <el-select v-model="Searchform.DocStatus" style="width:262px;" placeholder="请选择">
              <el-option value="" label="全部">全部</el-option>
              <el-option
                v-for="item in StatusOptions"
                :key="item.Code"
                :label="item.Name"
                :value="item.Code">
              </el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer cover">
          <el-button size="small" @click="Reset">重 置</el-button>
          <el-button size="small" @click="Query">确 定</el-button>
        </div>
      </el-dialog>
    </div>
</section>
</template>
<script>
import moment from 'moment';
import "../../../static/jquery.jqprint-0.3";
export default {
  name: "HistoryTable",
  data() {
    return {
      viewer: null, //viewer对象
      showNum: "", //传过来的参数
      key: "",
      total: 1000, //数据总数
      rows: 100, //每页显示多少条
      currentPage: 1,//当前页数
      moneyText: "",
      HistoryTableList: [],
      isshowList: true,
      isshowEditPay: false,
      isshowEditRcv: false,
      loading: false,
      PrintLoading: false,
      dialogRefundVisible: false, //还款
      dialogBusinessVisible: false, //借款
      dialogExpenseVisible: false, //报销
      dialogUploadVisible: false,//上传窗口
      checkflowRowVisible: false, //外面的流程图
      checkflowVisible: false, //里面的流程图
      dialogSearchVisible:false,//查询窗口
      StatusOptions:[],//状态列表
      TypeOptions:[],//业务类型
      formLabelWidth:'120px',
      dialogPayVisible: false,
      UploadList: [], //附件列表数据
      isShowPayment: true, //预收款
      isAdvanceDetails: true, //预收明细
      docRowView:[],//外部流程图
      docView:[],//内部流程图
      docDate:"",//日期
      DocNo:"",//单据编号
      docViewloading:false,
      state: 0,
      paymentsPrint:[],
      paymentsTemp:[],
      isSwitch: false, //开关 初始是flase
      CollectionMoney:0,
      describe:"",//描述
      Type:0,
      Msg:'',
      detail: [
        {
          IncomeMoney: 0, //金额
          Department: "", //部门
          BudgetItem: "" //类型
        }
      ],
      //打印的数据
      printsData: {
        entity: {
          BorrowLineSet: []
        }
      }, 
      dialogPayPrintVisible:false,      
      dialogRcvPrintVisible:false,
      BorrowPrintVisible:false,//借款单流程打印
      BorrowPrintHandleVisible:false,//借款单处理打印
      RefundPrintVisible:false,//还款单流程打印
      RefundPrintHandleVisible:false,//还款单处理打印
      ExpensePrintVisible:false,//报销单流程打印
      ExpensePrintHandleVisible:false,//报销单处理打印
      detailTemp:[],
      Searchform: {
          StartMoney:0,
          EndMoney:0,
          StartDate:'',
          EndDate:'',
          DocNo:'',
          VoucherNO:'',
          Title:'',
          Type:'',
          DocStatus:''
      },
      RefundMoneyObj: {//还款单
        ER_Tite: "",
        dt: [{}]
      }, 
      BusinessObj: {//借款单
        ER_Tite: "",
        dt: [{
          bank: "",
          bankAccount: ""
        }]
      }, 
      ExpenseObj: {//还款单
        ER_Tite: "",
        dt: [{}]
      },
      budgetItemList: [], //收入类型
      baseDeptList: [], //部门
      ReceivingTypeList: [], //收付款方式列表
      receivingType: '',//收付款方式model
      Customer: [], //客户
      custom: [], //客户
      PeriodList: [], //现金期间列表
      period: "", //现金期间model
      PeriodList: [], //现金期间列表
      bankList: [], //供应商银行
      bank:'',//供应商银行model
      bankAccount:'',//银行卡号
      applyMoney:0, //申请金额
      SupplierList:[],//供应商列表
      supplier:'',//供应商
      CashFlowList: [], //现金流量列表
      cashFlow:'',//现金流量model
      AccountItemList:[],//获取对方科目列表
      AssistItemList:[],//辅助核算项目
      budgetList:[
        {
          Money:'',//金额
          accountItem:'',//对方科目
          assistItem:''//辅助核算项目
        }
      ],
      budgetListTemp:[],
      //沟通模块
      dialogCommunicationVisible:false,//沟通窗口      
      CommunicationContentList:[],//沟通内容列表
      contentInput:'',//输入内容Model
      acquiescenceImg:'static/content/images/Header-S.png',//默认头像
      LaunchList:[],//沟通对象集合
      launch:[],//沟通对象
      launchChecked:false,//是否允许编辑
      requestEmp:'',//申请人ID
      communiTypes:0,//获取沟通状态
      isshowLauch:false,
      DocType:0,
      mouse_enter_Rcv_DocNO:'',
      communicateButtonDisabled:false,//沟通按钮是否置灰
      fjBtnDisabled: true,//附件按钮置灰true
    };
  },
  methods: {
    rowDblclickFn(...arr){
      let targetObj=arr[0];
      if(targetObj.RecordType===0){//查看
        this.handleCheck(arr);
      }else{//编辑
        this.handleEdit(arr);
      }
    },
    cellMouseEnterTwoFn(...arr){//鼠标移速单元格触发事件
      this.mouse_enter_Rcv_DocNO=arr[0].DocNO
    },
    cellMouseEnterFn(...arr){//鼠标移速单元格触发事件
      this.mouse_enter_Rcv_DocNO=arr[0].Rcv_DocNO
    },
    cellMouseLeaveFn(){
      this.mouse_enter_Rcv_DocNO=""
    },
    doCloseFn(){
      this.dialogPayVisible = false;
      console.log("doCloseFn")
      // console.log(this.paymentsTemp,"paymentsTemp弹框");
      // console.log(this.paymentsPrint,"paymentsPrint当前表格");
      this.paymentsTemp.forEach(aItem=>{
        let sIndex=this.paymentsPrint.findIndex(bItem=>aItem.Income_DocNo===bItem.Income_DocNo);
        if (sIndex==-1) {
          aItem.Money=''
        }else if(sIndex!==-1){
          aItem.Money=this.paymentsPrint[sIndex]['Money'];
        }
      })
    },
    changeMoneyToZero(obj){//删除收款明细某行
      let dele_Rcv_DocNO=obj.row.Rcv_DocNO;
      this.paymentsPrint.splice(obj.$index,1);
      this.paymentsTemp.forEach(item=>{
        if (item.Rcv_DocNO==dele_Rcv_DocNO) {
          item.Money=""
        }
      })
    },
    // 收款明细删除按钮
    handleDelete(index) {
      this.$confirm("确认删除该记录吗?", "提示", {
        type: "warning"
      }).then(() => {
        this.detail.splice(index, 1);
        this.$message({
          message: "已删除",
          type: "success"
        });
        if (this.detail.length==0) {//默认留一空行
          this.addlist()
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消'
        });           
      });
    },
    // 获取付款方式的中文字段。 
    PayAccountItemString(id){
      // 根据这个id 去找
      const result  = this.ReceivingTypeList.filter(item=> item.AccountItem_Code == id );
      return result[0] ? result[0].AccountItem_Name : ''
    },
    // 获取现金流量类型的中文字段
    CashFlowItemString(id){
      const result = this.CashFlowList.filter(item => item.CashFlowItem_Code ==id );
      return result[0] ? result[0].CashFlowItem_Name : ''
    },
    // 获取现金期间的中文字段
    PeriodString(id){
      const result = this.PeriodList.filter(item => item.Period_Code ==id );
      return result[0] ? result[0].Period_Name : ''
    },
    formatDate(row, column) {
      //如果日期存在的 才格式化
      return row.DocDate.split("T", 1);
    },
    formatUploadDate(row, column) {
      return row.Attachment_UploadDate.split("T", 1);
    },
    changePage(page) {//当前页数
      this.currentPage = page;
      this.getList();
    },
    async getList() {
      this.loading = true;
      const res = await axios.get("getHistoryTableList",{
        page:this.currentPage,
        rows:this.rows
      })
      this.total = res.total;
      this.HistoryTableList = res.rows;
      this.loading = false;
    },
    search(){
			this.dialogSearchVisible = true;
			this.getStatusList();
			this.getTypes();
		},
		async getStatusList(){
			this.StatusOptions = await axios.get('getStatusList');
		},
		async getTypes(){
			this.TypeOptions = await axios.get('getTypeOptions');
		},
		/*
		*  查询 
		*/
		async Query(){
    if(new Date(this.Searchform.StartDate)>new Date(this.Searchform.EndDate)){
			console.log(new Date(this.Searchform.StartDate),'this.Searchform.StartDate')
			console.log(new Date(this.Searchform.EndDate),'this.Searchform.EndDate')
			this.$message({
			message: '开始日期必须小于或者等于结束时期！',
			type: 'warning',
			duration: 1200
			});
			return;
		}else if(this.Searchform.StartMoney>this.Searchform.EndMoney){
			this.$message({
			message: '开始金额必须小于或者等于结束金额！',
			type: 'warning',
			duration: 1200
			});
			return;
		}
		this.dialogSearchVisible = false;
		console.log(this.Searchform.StartDate ? moment(this.Searchform.StartDate).format('L') : '','1');
		console.log(this.Searchform.EndDate ? moment(this.Searchform.EndDate).add(1,"d").format('L') : '','2');
		let filterName = {
			"groupOp": "AND",
			"rules": [{
			"field": "DocNO",
			"dataType": "string",
			"op": "cn",
			"data": this.Searchform.DocNo || ''
			}, {
      "field": "Voucher_DocNO",
      "dataType": "string",
      "op": "cn",
      "data": this.Searchform.VoucherNO || ''
      },  {
			"field": "Title",
			"dataType": "string",
			"op": "cn",
			"data": this.Searchform.Title || ''
			},{
			"field": "Type",
			"dataType": "numeric",
			"op": "eq",
			"data": this.Searchform.Type || ''
			},{
			"field": "DocStatus2",
			"dataType": "string",
			"op": "eq",
			"data": this.Searchform.DocStatus || ''
			}, {
			"field": "TotalMoney",
			"dataType": "numeric",
			"op": "ge",
			"data": this.Searchform.StartMoney || ''
			}, {
			"field": "TotalMoney",
			"dataType": "numeric",
			"op": "le",
			"data": this.Searchform.EndMoney || ''
			}, {
			"field": "DocDate",
			"dataType": "string",
			"op": "ge",
			"data": this.Searchform.StartDate ? moment(this.Searchform.StartDate).format('L') : ''
			}, {
			"field": "DocDate",
			"dataType": "string",
			"op": "le",
			"data": this.Searchform.EndDate ? moment(this.Searchform.EndDate).add(1,"d").format('L') : ''
			}],
			"groups": []
		}
		this.loading = true;
		const res = await axios.post("getHistoryTableList", { 
			filter:JSON.stringify(filterName),
			type:2,
			page:this.currentPage,
			rows:this.rows,
		});
		this.total = res.total;//总页数
		this.HistoryTableList = res.rows;
		this.loading = false;
		},
		Reset(){
			this.Searchform = {
				StartMoney:0,
				EndMoney:0,
				StartDate:'',
				EndDate:'',
				DocNo:'',
				Type:'',
				Title:'',
				DocStatus:''
			}
		},
    showChange() {
      if (this.isSwitch == true) {
        this.isShowPayment = false; //第一个
        this.isAdvanceDetails = true; //第二个
      } else if (this.isSwitch == false) {
        this.isShowPayment = true; //第一个
        this.isAdvanceDetails = false; //第二个
      }
    },
    // handleEdit(index,row){
    handleEdit(arr) {
      let row;
      if (arr) {
        row=arr[0];
      }
      if (!row) {
        this.showNum = this.$route.query.showNum;
        this.DocNo = this.$route.query.key;
        this.DocType = this.$route.query.DocType;
      } else {
        this.DocNo = row.DocNO;
        this.DocType = row.Type;
      }
      if(this.DocType==402){  
        this.isshowEditRcv = true; //编辑页面显示
        this.isshowList = false; //列表页面隐藏
        this.paymentsPrint = [];
        this.detail = [];
        let all = [
          axios.get("getWorkRcvOperation",{key:this.DocNo}),
          axios.get("getReceivingType"),
          axios.get('getWorkPeriod',{type:0}),     
        ];
        this.axios.all(all).then(
          this.axios.spread((res2,res3,res4)=>{
            this.custom = res2.entity.Rcv_PayCustomer;//客户
            const {Rcv_PayCustomer: AI_Code, CustomerName: AI_Name} = res2.entity;  
            this.Customer.push({AI_Code, AI_Name});
            this.Type = res2.Type;//0新增  1修改 2查看 3审核
            this.docDate = res2.entity.Rcv_DocDate;//日期model
            this.period  = res2.entity.Rcv_CashPeriod;//现金期间model
            this.PeriodList = res4;//现金期间列表   
            this.communiTypes = res2.AllowCommunication;//获得沟通对象      
            this.IsCommunicate(); 
            this.receivingType = res2.entity.Rcv_RcvAccountItem;//收款类型model
            this.ReceivingTypeList = res3;//收款类型列表          
            this.CollectionMoney = res2.entity.Rcv_TotalRcvMoney;//收款金额model
            this.describe = res2.entity.Rcv_Title;//描述
            this.isSwitch = res2.entity.Rcv_RcvType==2;//切换开关
            if(this.isSwitch == true) {
              this.isShowPayment = false; //第一个
              this.isAdvanceDetails = true; //第二个
            } else if (this.isSwitch == false) {
              this.isShowPayment = true; //第一个
              this.isAdvanceDetails = false; //第二个
            }
            this.detailTemp = res2.CB_RcvLine;//预收明细
            //this.fjBtnDisabled = res2.FJNum==0?true:false;
            if (this.Type==1) {//修改状态附件按键亮起
              this.fjBtnDisabled=false;
            }else{//查看和待审核状态，有附件数才亮起
              this.fjBtnDisabled = res2.FJNum==0?true:false;
            }
            this.detail.length = 0;
            for (let i = 0; i < this.detailTemp.length; i++) {
              this.detail.push({
                IncomeMoney: this.detailTemp[i].Money,
                Department: this.detailTemp[i].YBL_Department,
                BudgetItem: this.detailTemp[i].YBL_BudgetItem,
              })
            }
            //调用部门和收入类型和产品接口函数
            this.getIncomeBudget();
            //获取选择收入确认单接口
            axios.get('getWorkIncome',{
              PayCustomer: this.custom, //客户编号
              Type: this.Type, //0是新建
              key: this.DocNo //单据编号
            }).then(res=>{
                this.payments = res;
                res.forEach(item=>{
                  if (item.Money==0) {
                    item.Money=""
                  }
                })
                this.paymentsTemp = res;
                this.paymentsPrint = res; //先清空
                const tempArr = JSON.parse(JSON.stringify(this.paymentsPrint)); //浅拷贝数组
                this.paymentsPrint = [];
                tempArr.map(item =>{
                  //不为0的 才push上去
                  item.Income_TotalIncomeMoney = Number(item.Income_TotalIncomeMoney);
                  item.Surplus = Number(item.Surplus);
                  item.Money = Number(item.Money);
                  if (item.Money !== 0) {
                    // console.log(item.Money,'item.Money');
                    this.paymentsPrint.push(item);
                  }
                })
            }).catch(err=>{
              console.log(err);
            })
          })
        )
      } else if(this.DocType==401){
        this.isshowEditPay = true; //编辑页面显示
        this.isshowList = false; //列表页面隐藏
        axios.get('getWorkPayOperation',{
          key:this.DocNo
        }).then(res=>{
          this.Type = res.Type;
          this.supplier = res.entity.Pay_Supplier;
          this.communiTypes = res.AllowCommunication;//获得沟通对象
          this.IsCommunicate();
          this.cashFlow = res.entity.Pay_CashFlowItem;
          this.receivingType = res.entity.Pay_PayAccountItem;
          this.DocNo = res.entity.Pay_DocNO;
          this.docDate = res.entity.Pay_DocDate;
          this.applyMoney = res.entity.Pay_TotalPayMoney;
          this.describe = res.entity.Pay_Title;
          this.bank = res.entity.Pay_RcvBank;
          this.period = res.entity.Pay_CashPeriod;
          //this.fjBtnDisabled = res.FJNum==0?true:false;
          if (this.Type==1) {//修改状态附件按键亮起
            this.fjBtnDisabled=false;
          }else{//查看和待审核状态，有附件数才亮起
            this.fjBtnDisabled = res.FJNum==0?true:false;
          }
          this.getSupplier();//获取供应商接口
          this.getSupplierBank();//获取供应商银行
          this.getCashFlow();//现金流量类型           
          this.getReceivingType();//付款方式          
          this.getPeriod();//现金期间   
          this.getAccountItem();//对方科目 
          axios.get('getPayLink',{
            key:this.DocNo
          }).then(res => {
            this.budgetListTemp = res;
            this.budgetList.length = 0;
            for(let i = 0; i< this.budgetListTemp.length;i++){
              this.budgetList.push({
                Money:this.budgetListTemp[i].PayLine_PayMoney,//金额
                accountItem:this.budgetListTemp[i].PayLine_OtherAccountItem,//对方科目
                assistItem:this.budgetListTemp[i].PayLine_AssistItem//辅助核算项目
              })
            }
            //获取辅助核算项目数据
            for(let i = 0;i < this.budgetList.length; i++) {
                axios.get('getAssistItem',{
                  code: this.budgetList[i].accountItem
                }).then(res=>{
                  if(res[0]){
                    this.$set(this.AssistItemList, i, res[0].data);//vue特定的改变数组的方式
                    this.Name = res[0].AIT_Name;
                  }else{
                    this.$set(this.AssistItemList, i, []);//vue特定的改变数组的方式
                  }
                 /*  cb && cb(); *///如果回掉函数存在，就执行
                }).catch(err=>{
                  console.log(err);
                })    
            }  
          }).catch(err=>{
            console.log(err);            
          })
        }).catch(err=>{
          console.log(err);
        })
      } 
    },
    IsCommunicate(){
      let This=this;             
      this.getMayHaveCommunicationFn({key:This.DocNo,DocType:This.DocType,type:this.Type}).then((res)=>{
        This.communicateButtonDisabled=false
        //判断状态获取沟通
        if(this.communiTypes==1||this.communiTypes==2){ 
          this.dialogCommunicationVisible = true;
          this.isshowLauch = false;
          let all = [
            axios.get('CommunicationContent',{
              key:this.DocNo,
              DocType:this.DocType
            }),
            axios.get('LaunchList',{
              key:this.DocNo,
              DocType:this.DocType
            }),
          ];
          this.axios.all(all).then(
            this.axios.spread((res1,res2)=>{
              this.CommunicationContentList = res1;//获得沟通内容
                for(var i=0;i<this.CommunicationContentList.length;i++){
                  if(this.CommunicationContentList[i].Img==''){//如果是空的
                    const ac = this.acquiescenceImg;
                    this.CommunicationContentList[i].Img = ac;//赋值默认头像
                  }
                }
                this.requestEmp = res2.RequestEmp;//申请人ID
                this.LaunchList = res2.us;//获得沟通对象  
            })
          )   
        }
      }).catch(err=>{
        This.communicateButtonDisabled=true
      })
    },
    //沟通窗口打开 
    Communication(){
      this.dialogCommunicationVisible = true;
      this.isshowLauch=false;
      let all = [
          axios.get('CommunicationContent',{
            key:this.DocNo,
            DocType:this.DocType
          }),
          axios.get('LaunchList',{
            key:this.DocNo,
            DocType:this.DocType
          }),
          axios.get('getCommuniState',{
            key:this.DocNo,
            DocType:this.DocType,
            types:this.Type
          })
      ];
      this.axios.all(all).then(
        this.axios.spread((res1,res2,res3)=>{
            this.CommunicationContentList = res1;//获得沟通内容
            for(var i=0;i<this.CommunicationContentList.length;i++){
              if(this.CommunicationContentList[i].Img==''){//如果是空的
                const ac = this.acquiescenceImg;
                this.CommunicationContentList[i].Img = ac;//赋值默认头像
              }
            }
            this.requestEmp = res2.RequestEmp;//申请人ID
            this.LaunchList = res2.us;//获得沟通对象  
            this.communiTypes = res3;//获取沟通状态
        })
      )   
    },
    //允许提交者编辑单据Change事件
    launchChange(e){
      if(e){
        console.log(this.requestEmp,'this.requestEmp');
        console.log(this.launch,'this.launch');
        let bo=true;
        for(let i=0;i<this.launch.length;i++)
        { 
          if(this.launch[i]==this.requestEmp)
          bo=false;      
        }
        if(bo)this.launch.push(this.requestEmp);
      }
    },
    //确认后提交
    CommunicationDetermine(){
      if(this.isshowLauch == true)
      {
        this.$confirm('回复沟通单据将会自动提交，不可再编辑!', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
           this.Communicate();
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          });           
        });
      }else{
        this.Communicate();
      }
    },
    //沟通窗口 确定按钮
    Communicate(){
      let user='';
      for(let i=0;i<this.launch.length;i++){ 
          user+=i!=0?',':'';
          user+=this.launch[i];
      }    
      axios.get('AddCommunicate',{
          key:this.DocNo,
          DocType:this.DocType,
          msg:this.contentInput,
          user:user,
          bj:this.launchChecked ? 1 : 0,
          type:this.communiTypes
      }).then(res=>{
          if(res.Success===true){
            if(this.isshowLauch == true){
            if(this.DocType=='401') 
              this.PaySubmitForm();
              else 
              this.RcvSubmitForm();
            }
              //获得沟通内容
              this.getContent();
              this.$message({
                message: res.Message,
                type: 'success',
                duration: 1200
              })
              this.getState();
              this.contentInput = '';
            
          }else{
            this.$message({
              message: res.Message,
              type: 'warning',
              duration: 1200
            })
          }
      }).catch(err=>{
          console.log(err);
      })      
      
    },
    //获取内容
    getContent(){
      axios.get('CommunicationContent',{
        key:this.DocNo,
        DocType:this.DocType
      }).then(res=>{
        this.CommunicationContentList = res;
        for(var i=0;i<this.CommunicationContentList.length;i++){
            if(this.CommunicationContentList[i].Img==''){//如果是空的
                const ac = this.acquiescenceImg;
                this.CommunicationContentList[i].Img = ac;//赋值默认头像
            }
        }    
      })
    },
    //获取type
    getState(){
      axios.get('getCommuniState',{
        key:this.DocNo,
        DocType:this.DocType,
        types:this.Type
      }).then(res=>{
        this.communiTypes = res;
      }).catch(err=>{
        console.log(err);
      })
    },
    //获得部门和收入类型和产品
    getIncomeBudget() {
      axios.get("getIncomeBudget").then((res) => {
        this.budgetItemList = res.Base_BudgetItem; //收入类型
        this.baseDeptList = res.Base_Dept; //部门
      }).catch((err) => {
        console.log(err);
      })
    },
    validationRcvFn(){//验证收款单
      let printArr = [];
      let paymentsPrint = this.paymentsPrint;
      paymentsPrint.forEach(value => {
        let money = value.Money; //金额
        let id = value.Income_DocNo; //ID
        let temp = `{"je":${money},"ID":"${id}"}`;
        printArr.push(temp);
      });
      let sr = printArr.join(","); //逗号分割并拼接备份给json字符串传参
      sr = `[` + sr + `]`;

      let budgetArr = [];
      this.detail=this.detail.filter(item=>(item.IncomeMoney||item.Department||item.BudgetItem))
      if (this.detail.length==0) {
        this.addlist();
      }      
      let detail = this.detail;
      detail.forEach(value => {
        let money = value.IncomeMoney; //金额
        let depart = value.Department; //部门
        let budget = value.BudgetItem; //收入类型
        let temp2 = `{"Money":${money},"Dept":"${depart}","Budget":"${budget}"}`;
        budgetArr.push(temp2);
      });
      let ysline = budgetArr.join(",");
      ysline = `[` + ysline + `]`;

      let params = {
        Rcv_DocDate: this.docDate,//日期
        Rcv_CashPeriod: this.period,//现金期间
        Rcv_PayCustomer: this.custom,//客户
        Rcv_RcvAccountItem: this.receivingType,//收款方式
        Rcv_TotalRcvMoney: this.CollectionMoney,
        Rcv_Title: this.describe,//描述
        key: this.DocNo,
        Rcv_RcvType: this.isSwitch===false?0:2,//0=未勾上预收款  2=以勾上预收款
        SR: sr,//选择的收入确认单
        YSLine: ysline,//预收款添加的明细
        Rcv_DocStatus: 2,//1=保存  2=提交
        key:this.DocNo
      }
      let That=this;
      return new Promise(function(resolve,reject){
        axios.get('cbRcvVerification', params).then(res=>{
          if (res.Success == true) {
            resolve()
          } else {
            That.$message({
              message: res.Message,
              type: "warning",
              duration:1500              
            });
          }
        }).catch(err=>{
          console.log(err,"err")
        });
      })

    },    
    //收款单
    // editRcvSubmit(){
    //   this.getState();
    //   if(this.communiTypes===2){ 
    //     this.isshowLauch = true;
    //     this.dialogCommunicationVisible = true;
    //   } else {
    //     this.RcvSubmitForm();
    //   }
    // },
    editRcvSubmit(){
      this.validationRcvFn().then(res=>{
        this.getState();
        if(this.communiTypes===2){ 
          this.isshowLauch = true;
          this.dialogCommunicationVisible = true;
        } else {
          this.RcvSubmitForm();
        }
      })
    },
    /**
     * 编辑收款 提交
     */
    RcvSubmitForm(){
      let printArr = [];
      let paymentsPrint = this.paymentsPrint;
      paymentsPrint.forEach(value => {
        let money = value.Money; //金额
        let id = value.Income_DocNo; //ID
        let temp = `{"je":${money},"ID":"${id}"}`;
        printArr.push(temp);
      });
      let sr = printArr.join(","); //逗号分割并拼接备份给json字符串传参
      sr = `[` + sr + `]`;

      let budgetArr = [];
      this.detail=this.detail.filter(item=>(item.IncomeMoney||item.Department||item.BudgetItem))
      if (this.detail.length==0) {
        this.addlist();
      }      
      let detail = this.detail;
      detail.forEach(value => {
        let money = value.IncomeMoney; //金额
        let depart = value.Department; //部门
        let budget = value.BudgetItem; //收入类型
        let temp2 = `{"Money":${money},"Dept":"${depart}","Budget":"${budget}"}`;
        budgetArr.push(temp2);
      });
      let ysline = budgetArr.join(",");
      ysline = `[` + ysline + `]`;

      let params = {
        Rcv_DocDate: this.docDate,//日期
        Rcv_CashPeriod: this.period,//现金期间
        Rcv_PayCustomer: this.custom,//客户
        Rcv_RcvAccountItem: this.receivingType,//收款方式
        Rcv_TotalRcvMoney: this.CollectionMoney,
        Rcv_Title: this.describe,//描述
        key: this.DocNo,
        Rcv_RcvType: this.isSwitch===false?0:2,//0=未勾上预收款  2=以勾上预收款
        SR: sr,//选择的收入确认单
        YSLine: ysline,//预收款添加的明细
        Rcv_DocStatus: 2,//1=保存  2=提交
        key:this.DocNo
      }
      axios.post('addWorkSubmit',params)
        .then(res =>{
          if (res.Success == true) {
            this.$message({
                message: `提交成功`,
                type: "success",
                duration:1500
            });
            this.dialogCommunicationVisible = false;
            this.isshowEditRcv = false;
            this.isshowList = true;
            this.getList();
          }else{
            this.$message({
              message: res.Message,
              type: "warning",
              duration:2000          
            });
          }
        })
        .catch(err =>{
          console.log(err);
        })
    },
    /**
     * 编辑收款 保存
     */
    editRcvSave(){
      let printArr = [];
      let paymentsPrint = this.paymentsPrint;
      paymentsPrint.forEach(value => {
        let money = value.Money; //金额
        let id = value.Income_DocNo; //ID
        let temp = `{"je":${money},"ID":"${id}"}`;
        printArr.push(temp);
      });
      let sr = printArr.join(","); //逗号分割并拼接备份给json字符串传参
      sr = `[` + sr + `]`;

      let budgetArr = [];
      this.detail=this.detail.filter(item=>(item.IncomeMoney||item.Department||item.BudgetItem))
      if (this.detail.length==0) {
        this.addlist();
      }
      let detail = this.detail;
      detail.forEach(value => {
        let money = value.IncomeMoney; //金额
        let depart = value.Department; //部门
        let budget = value.BudgetItem; //收入类型
        let temp2 = `{"Money":${money},"Dept":"${depart}","Budget":"${budget}"}`;
        budgetArr.push(temp2);
      });
      let ysline = budgetArr.join(",");
      ysline = `[` + ysline + `]`;

      let params = {
        Rcv_DocDate: this.docDate,//日期
        Rcv_CashPeriod: this.period,//现金期间
        Rcv_PayCustomer: this.custom,//客户
        Rcv_RcvAccountItem: this.receivingType,//收款方式
        Rcv_TotalRcvMoney: this.CollectionMoney,
        Rcv_Title: this.describe,//描述
        key: this.DocNo,
        Rcv_RcvType: this.isSwitch===false?0:2,//0=未勾上预收款  2=以勾上预收款
        SR: sr,//选择的收入确认单
        YSLine: ysline,//预收款添加的明细
        Rcv_DocStatus: 1,//1=保存  2=提交
        key:this.DocNo
      }
      axios.post('addWorkSubmit',params)
        .then(res =>{
          if (res.Success == true) {
            this.$message({
                message: `保存成功`,
                type: "success",
                duration:1200
            });
            if(res.data.DocNO){
              this.DocNo = res.data.DocNO
            }
          }else{
            this.$message({
              message: res.Message,
              type: "warning",
              duration:2000          
            });
          }
        })
        .catch(err =>{
          console.log(err);
        })
    },
    validationPayFn(){//验证付款单
      let myArr = [];
      this.budgetList=this.budgetList.filter(item=>(item.Money||item.accountItem||item.assistItem))
      if (this.budgetList.length==0) {
        this.addBudgetlist();
      }
      let budgetList = this.budgetList;
      budgetList.forEach(value => {
        let money = value.Money;
        let accountItem = value.accountItem; //对方科目
        let assistItem = value.assistItem; //辅助核算项目
        let temp = `{"Money":${money},"Account":"${accountItem}","fzhs":"${assistItem}"}`;
        myArr.push(temp);
      });
      let Budget = myArr.join(","); //逗号分割并拼接备份给json字符串传参
      Budget = `[` + Budget + `]`;

      let params = {
        Pay_Supplier:this.supplier,
        Pay_RcvBank:this.bank,
        Pay_DocDate:this.docDate,
        Pay_CashFlowItem:this.cashFlow,
        Pay_PayAccountItem:this.receivingType,
        Pay_CashPeriod:this.period,
        Pay_TotalPayMoney:this.applyMoney,
        Pay_Title:this.describe,
        Pay_RcvBankAccount:this.bankAccount,
        key:this.DocNo,
        Pay_DocStatus:2,//2是提交
        Budget:Budget,//预算明细
        key:this.DocNo
      }
      let That=this;
      return new Promise(function(resolve,reject){
        axios.get('cbPayVerification', params).then(res=>{
          if (res.Success == true) {
            resolve()
          } else {
            That.$message({
              message: res.Message,
              type: "warning",
              duration:1500              
            });
          }
        }).catch(err=>{
          console.log(err,"err")
        });
      })

    },    
    //付款单
    // editPaySubmit(){
    //   this.getState();
    //   if(this.communiTypes===2){ 
    //     this.isshowLauch = true;
    //     this.dialogCommunicationVisible = true;
    //   } else {
    //     this.PaySubmitForm();
    //   }
    // },
    editPaySubmit(){
      this.validationPayFn().then(res=>{
        this.getState();
        if(this.communiTypes===2){ 
          this.isshowLauch = true;
          this.dialogCommunicationVisible = true;
        } else {
          this.PaySubmitForm();
        }
      })
    },
    /**
     * 编辑付款 提交
     */
    PaySubmitForm(){
      let myArr = [];
      this.budgetList=this.budgetList.filter(item=>(item.Money||item.accountItem||item.assistItem))
      if (this.budgetList.length==0) {
        this.addBudgetlist();
      }
      let budgetList = this.budgetList;
      budgetList.forEach(value => {
        let money = value.Money;
        let accountItem = value.accountItem; //对方科目
        let assistItem = value.assistItem; //辅助核算项目
        let temp = `{"Money":${money},"Account":"${accountItem}","fzhs":"${assistItem}"}`;
        myArr.push(temp);
      });
      let Budget = myArr.join(","); //逗号分割并拼接备份给json字符串传参
      Budget = `[` + Budget + `]`;

      let params = {
        Pay_Supplier:this.supplier,
        Pay_RcvBank:this.bank,
        Pay_DocDate:this.docDate,
        Pay_CashFlowItem:this.cashFlow,
        Pay_PayAccountItem:this.receivingType,
        Pay_CashPeriod:this.period,
        Pay_TotalPayMoney:this.applyMoney,
        Pay_Title:this.describe,
        Pay_RcvBankAccount:this.bankAccount,
        key:this.DocNo,
        Pay_DocStatus:2,//2是提交
        Budget:Budget,//预算明细
        key:this.DocNo
      }
      axios.get('addPaySubmit',params).then(res=>{
        if (res.Success == true) {
          this.$message({
            message: `提交成功`,
            type: "success",
            duration:1200
          });
          this.dialogCommunicationVisible = false;
          this.isshowEditPay = false;
          this.isshowList = true;
          this.getList();
        }else{
          this.$message({
            message: res.Message,
            type: "warning",
            duration:1500
          });
        }
      }).catch(err=>{
        console.log(err);
      })
    },
    /**
     * 编辑付款 保存
     */
    editPaySave(){
      let myArr = [];
      this.budgetList=this.budgetList.filter(item=>(item.Money||item.accountItem||item.assistItem))
      if (this.budgetList.length==0) {
        this.addBudgetlist();
      }
      let budgetList = this.budgetList;
      budgetList.forEach(value => {
        let money = value.Money;
        let accountItem = value.accountItem; //对方科目
        let assistItem = value.assistItem; //辅助核算项目
        let temp = `{"Money":${money},"Account":"${accountItem}","fzhs":"${assistItem}"}`;
        myArr.push(temp);
      });
      let Budget = myArr.join(","); //逗号分割并拼接备份给json字符串传参
      Budget = `[` + Budget + `]`;

      let params = {
        Pay_Supplier:this.supplier,
        Pay_RcvBank:this.bank,
        Pay_DocDate:this.docDate,
        Pay_CashFlowItem:this.cashFlow,
        Pay_PayAccountItem:this.receivingType,
        Pay_CashPeriod:this.period,
        Pay_TotalPayMoney:this.applyMoney,
        Pay_Title:this.describe,
        Pay_RcvBankAccount:this.bankAccount,
        key:this.DocNo,
        Pay_DocStatus:1,//1是保存
        Budget:Budget,//预算明细
        key:this.DocNo
      }
      axios.get('addPaySave',params).then(res=>{
        if (res.Success == true) {
          this.$message({
            message: `保存成功`,
            type: "success",
            duration: 1200,
          });
          if(res.data.DocNO){
            this.DocNo = res.data.DocNO
          }
        }else{
          this.$message({
            message: res.Message,
            type: "warning",
            duration: 1500
          });
        }
      }).catch(err=>{
        console.log(err);
      })
    },
    //供应商
    async getSupplier() {
      this.SupplierList = [];
      const res = await axios.get("getRcvOther")
      this.SupplierList = res;
      console.log(this.SupplierList,'this.SupplierList');
    },
    //供应商银行
    getSupplierBank() {
      axios
        .get("getSupplierBank", {
          Code: this.supplier, //供应商Code
          Type: 1 //对公
        })
        .then(res => {
         this.bankList = res;
         if(this.bankList.length==0 ||((!this.bankList[0].Bank) && 
          (!this.bankList[0].BankAccpunt) && 
          (!this.bankList[0].Code))){
            this.bank = '';
            this.bankAccount = '';
          }else{
            this.bank = res[0].Bank; //默认开户银行
            this.bankAccount = res[0].BankAccount; //默认银行卡
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    
    //改变供应商时候 重新获取银行接口
    choiceSupplie(){
      this.getSupplierBank();
    },
    //现金期间
    getPeriod(){
      axios.get('getWorkPeriod',{type:0}).then(res=>{
        this.PeriodList = res;
      }).catch((err)=>{
        console.log(err);
      })
    },
     //现金流量类型
    getCashFlow(){
      axios.get('getCashFlow').then(res=>{
        this.CashFlowList = res;
        console.log(res)
      }).catch(err=>{
        console.log(err);
      })
    },
    //付款方式
    async getReceivingType() {
      this.ReceivingTypeList = await axios.get("getReceivingType");
    },
    //获取对方科目对方科目
    async getAccountItem(){
      this.AccountItemList = await axios.get('getAccountItem');
    },
    //获取辅助核算项目
    getAssistItem(cb, index){  
      axios.get('getAssistItem',{
        code: this.accountItem,
      }).then(res=>{
        if(res[0]){
          //this.AssistItemList = res[0].data;
          this.$set(this.AssistItemList, index, res[0].data);//vue特定的改变数组的方式
          this.Name = res[0].AIT_Name;
        }else{
          // this.AssistItemList = [];
          this.$set(this.AssistItemList, index, []);//vue特定的改变数组的方式
        }
        cb && cb();//如果回掉函数存在，就执行
      }).catch(err=>{
        console.log(err);
      })
    },
    //改变对方科目时候
    changeAccountItem(index,e,event){
      if(event) 
      return; //如果下拉展开就不执行后面的了
      this.Name = '', 
      this.budgetList[index].assistItem = '',//先清空辅助核算项目旧model数据
      /* this.$set(this.AssistItemList, index, []); */
      this.accountItem = e;//当前赋值改变的科目类型
      //cb是回掉函数，index是选中的行数
      this.getAssistItem(()=>{    
          let cache = Object.assign({},this.budgetList[index]);
          cache.name = this.Name;
          this.$set(this.budgetList, index, cache);
          console.log(this.budgetList,'this.budgetList');          
      }, index);//然后调用辅助核算项目
    },
    //付款删除
    PayDelete(index){
      this.$confirm("确认删除该记录吗?", "提示", {
        type: "warning"
      }).then(() => {
        this.budgetList.splice(index, 1);
        this.AssistItemList.splice(index, 1);
        // console.log(this.AssistItemList);
        this.$message({
          message: "已删除",
          type: "success",
          duration:800     
        });
        if(this.budgetList.length==0){
          this.addBudgetlist();
        }
      });
    },
    // 新建返回到列表页面
    editToRcvBack() {
      this.isshowEditRcv = false; //收款单编辑页面隐藏
      this.isshowList = true; //列表页面显示
      this.getList();
    },
    editToPayBack(){
      this.isshowEditPay = false; //付款编辑页面隐藏
      this.isshowList = true; //列表页面显示
      this.getList();
    },
    getPaymentAddDiaLog() {
      // console.log(this.paymentsTemp,"paymentsTemp1")
      if(this.paymentsTemp.length<=0){
        axios.get("getWorkIncome", {
              PayCustomer: this.custom, //客户编号
              Type: this.Type, //0是新建
              key: this.DocNo //单据编号
            })
            .then(res => {
              this.payments = res;
              this.paymentsTemp = res;
              this.paymentsTemp.forEach(item => {
                item.Income_TotalIncomeMoney = item.Income_TotalIncomeMoney === 0 ? "" : item.Income_TotalIncomeMoney;
                item.Surplus = item.Surplus === 0 ? "" : item.Surplus;
                item.Money = item.Money === 0 ? "" : item.Money;
              });
              // let paymentsTempArr=this.this.paymentsTemp;
              // this.paymentsTemp=[];
              // this.paymentsTemp=paymentsTempArr;
              // console.log(this.paymentsTemp,"paymentsTemp2")
            })
            .catch(err => {
              console.log(err);
            });
      }
      this.dialogPayVisible = true;
    },
    addlist() {
      this.detail.push({
        IncomeMoney: "", //金额
        Department: "", //部门
        BudgetItem: "" //类型
      });
    },
    changeCustom(e) {
      this.paymentsPrint = [];
    },
    confirm() {
      //打印到备用数组上
      let myArr = []; //为了传参
      const tempArr = JSON.parse(JSON.stringify(this.paymentsTemp)); //paymentsTemp =>最终呈现在列表上的data
      this.paymentsPrint = [];
      tempArr.map(item => {
        //不为0的 才push上去
        item.Money = Number(item.Money).toFixed(2); //先转数字类型，再保留两位小数
        if (item.Money != 0.0 || item.Money != 0) {
          //如果不为0的 才push进去
          this.paymentsPrint.push(item);
        }
      });
      this.dialogPayVisible = false; //关闭弹窗
    },
    cancel() {
      this.dialogRefundVisible = false;
      this.dialogBusinessVisible = false;
      this.dialogExpenseVisible = false;
      this.dialogPayVisible = false;
    },
    //查看
    // handleCheck(index, row) {
    handleCheck(rest) {
      let row=rest[0];
      this.Type = row.Type;
      let all = [
        axios.get("getReceivingType"), //收付款方式
        axios.get("getCashFlow"), //现金流量
        axios.get("getWorkPeriod", {
          type: 0
        }) //现金期间
      ];
      this.axios.all(all).then(
        this.axios.spread((res1, res2, res3) => {
          this.ReceivingTypeList = res1; //收付款方式
          this.CashFlowList = res2; //现金流量
          console.log(res2)
          this.PeriodList = res3; //现金期间
        })
      );
      //还款单
      if (this.Type == 303) {
        this.DocType = 303;
        this.dialogRefundVisible = true;
        axios
          .get("getWorkRefundMoney", {
            key: row.DocNO,
            type: this.Type
          })
          .then(res => {
            this.RefundMoneyObj = res;
            this.DocNo = res.dt[0].Repay_DocNO;
            if (this.CashFlowList.length > 0) {
              this.RefundMoneyObj.dt[0].Repay_CashFlowItem = this.CashFlowList[0].CashFlowItem_Code; //现金流量
            }
          })
          .catch(err => {
            console.log(err);
          });
      //借款单
      } else if (this.Type == 302) {
        this.DocType = 302;
        this.dialogBusinessVisible = true;
        //获取借款单详细信息
        axios
          .get("getWorkBusiness", {
            key: row.DocNO,
            type: this.Type
          })
          .then(res => {
            console.log(res)
            this.BusinessObj = res;
            this.DocNo = res.dt[0].Borrow_DocNO;
            this.CashFlowList.forEach(item,index,el,()=>{
              console.log(item.CashFlowItem_Code+":"+this.BusinessObj.dt[0].Borrow_CashFlowItem)
              if(item.CashFlowItem_Code==this.BusinessObj.dt[0].Borrow_CashFlowItem){
                this.moneyText = item.CashFlowItem_Name;
              }
            })
            //获取付款方式
            axios
              .get("getSupplierBank", {
                Code: this.BusinessObj.dt[0].Borrow_Supplier,
                Type: this.BusinessObj.dt[0].Borrow_BusinessType
              })
              .then(res1 => {
                this.bankList = res1;
                this.BusinessObj.dt[0].bank = res1[0].Bank;
                this.BusinessObj.dt[0].bankAccount = res1[0].BankAccount;
              })
              .catch(err => {
                console.log(err);
              });
          })
          .catch(err => {
            console.log(err);
          });
      } else if (this.Type == 301) {
        this.DocType = 301;
        this.dialogExpenseVisible = true;
        //获取报销单详细信息
        axios
          .get("getWorkExpense", {
            key: row.DocNO,
            type: this.Type
          })
          .then(res => {
            console.log(res)
            this.ExpenseObj = res;
            this.DocNo = res.dt[0].Expense_DocNO;            
            axios
              .get("getSupplierBank", {
                Code: this.ExpenseObj.dt[0].Expense_Supplier,
                Type: this.ExpenseObj.dt[0].Expense_BusinessType
              })
              .then(res1 => {
                this.bankList = res1;
                this.ExpenseObj.dt[0].bank = res1[0].Bank;
                this.ExpenseObj.dt[0].bankAccount = res1[0].BankAccount;
              })
              .catch(err => {
                console.log(err);
              });
          });
      }
    },
    //添加辅助核算项目
    addBudgetlist(){
      this.budgetList.push(
        {
          Money:'',//金额
          accountItem:'',//对方科目
          assistItem:''//辅助核算项目
        }
      )
    },
    //撤销
    repeal(index,row){
      this.$confirm("确认撤销该记录吗?", "提示", {
        type: "warning"
      })
        .then(() => {
          axios
            .post("RevokeHistoryWork", {
              key: row.DocNO,
              Type: row.Type
            })
            .then(res => {
              this.$message({
                message: res.Message,
                type: "success",
                duration:1500     
              });
              this.getList();
            })
            .catch(err => {
              console.log(err);
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    },
    async remoteMethod(query) {
      if (query !== '') {
          this.loading = true;
          this.Customer = await axios.post('getCustomerQuery', {query});
          this.loading = false;
      } else {
        this.Customer = [];
      }
    },
    //删除
    handleDel(index, row) {
      this.$confirm("确认删除该记录吗?", "提示", {
        type: "warning"
      }).then(() => {
        axios
          .post("getWorkDele", {
            key: row.DocNO,
            Type: row.Type
          })
          .then(res => {
            if (res.Success == true) {
              this.$message({
                message: res.Message,
                type: "success",
                duration:800     
              });
              setTimeout(() => {
                this.loading = false;
              }, 2000);
              this.getList();
            } else {
              this.$message({
                message: res.Message,
                type: "warning",
                duration:1500     
              });
            }
          })
          .catch(err => {
            console.log(err);
          });
      });
    },
    /**
     * 打印窗口
     */
    async getPrint() {
      if(this.DocType=="402"){//收款单
        this.dialogRcvPrintVisible = true;  
      }else if(this.DocType=="401"){//付款单 
        this.dialogPayPrintVisible = true;
      }
      this.PrintLoading = true;
      this.printsData = await axios.get("Print",{DocNo:this.DocNo,DocType:this.DocType});
      this.PrintLoading = false;
    },
    //收款流程打印
    printRcvPdf(){
      $("#formRcv").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //付款流程打印
    printPayPdf(){
      $("#formPay").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //借款单流程打印
    printBorrowPdf() {
      $("#formBorrow").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //还款单流程打印
    printRefundPdf() {
      $("#formRefund").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //报销单流程打印
    printExpensePdf() {
      $("#formExpense").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //借款单处理打印
    printBorrowPdf2() {
      $("#formBorrow2").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //还款单处理打印
    printRefundPdf2() {
      $("#formRefund2").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //报销单处理打印
    printExpensePdf2() {
      $("#formExpense2").jqprint({
        debug: false,
        importCSS: true,
        printContainer: false,
        operaSupport: false
      });
    },
    //审核提示
    async checkMsg(){this.Msg = await axios.get("checkMsg")},
    //借款处理打印窗口
    getBorrowHandlePrint(){
      this.BorrowPrintHandleVisible = true;
    },
    //借款单流程打印窗口
    async getBorrowPrint() {
      this.printsData = {
        entity: {
          BorrowLineSet: []
        }
      }
      this.BorrowPrintVisible = true;
      this.PrintLoading = true;
      this.printsData = await axios.get("Print",{DocNo:this.DocNo,DocType:this.DocType});
      this.PrintLoading = false;
    },
    //报销单处理打印窗口
    getExpenseHandlePrint(){
      this.ExpensePrintHandleVisible = true;
    },
    //报销单流程打印窗口
    async getExpensePrint(){
      this.printsData = {
        entity: {
          BorrowLineSet: []
        }
      }
      this.ExpensePrintVisible = true;
      this.PrintLoading = true;
      this.printsData = await axios.get("Print",{DocNo:this.DocNo,DocType:this.DocType});
      this.PrintLoading = false;
    },
    //还款单处理打印窗口
    getRefundHandlePrint(){
      this.RefundPrintHandleVisible = true;
    },
    //还款单流程打印窗口
    async getRefundPrint(){
      this.printsData = {
        entity: {
          BorrowLineSet: []
        }
      }
      this.RefundPrintVisible = true;
      this.PrintLoading = true;
      this.printsData = await axios.get("Print",{DocNo:this.DocNo,DocType:this.DocType});
      this.PrintLoading = false;
    },
    //收款单驳回 操作
    RcvReject() {
      let DocNo = this.DocNo;
      this.$prompt("请您输入驳回的理由", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消"
        })
        .then(({
          value
        }) => {
          this.$message({
            type: "success",
            message: "你的驳回的理由是：" + value
          });
          axios
            .get("RvcToExamine", {
              key: DocNo,
              type: 1, //0审核 1驳回
              Reason: value
            })
            .then(res => {
              this.$message({
                message: res,
                type: "success",
                duration:800
              });
              setTimeout(() => {
                this.$router.push({
                  path: "notAudit"
                });
              }, 500);
            })
            .catch(err => {
              console.log(err);
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "取消输入"
          });
        });
    },
    //收款单审核
    RcvAudit(){
      axios
      .get('ExamineCommunication',{
        key:  this.DocNo,
        DocType:  this.DocType
      }).then(res => {
        if(res.Data === '1'){
            this.$confirm(res.Message, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.ToExaminRcv();
            }).catch(() => {
                this.$message({
                type: "info",
                message: "已取消"
              });
            });
        } else if(res.Data === '2') {
          this.$message({
            type: "warning",
            message: res.Message,
            duration:1500 
          });
        }else
          this.ToExaminRcv();
        })
    },
    //收款单审核 操作
    ToExaminRcv() {
      this.checkMsg(); //审核提示
      this.$confirm(this.Msg, {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
        .then(() => {
          axios
            .get("RvcToExamine", {
              key: this.DocNo,
              type: 0 //0审核 1驳回
            })
            .then(res => {
              this.$message({
                type: "success",
                message: res,
                duration:800
              });
              setTimeout(() => {
                this.$router.push({
                  path: "notAudit"
                });
              }, 500);
            })
            .catch(err => {
              console.log(err);
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
          });
    },
    //付款单驳回 操作
    PayReject() {
      this.$prompt("请您输入驳回的理由", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消"
        })
        .then(({
          value
        }) => {
          this.$message({
            type: "success",
            message: "你的驳回的理由是：" + value
          });
          axios
            .get("PayToExamine", {
              key: this.DocNo,
              type: 1, //0审核 1驳回
              Reason: value
            })
            .then(res => {
              this.$message({
                message: res,
                type: "success",
                duration:800
              });
              setTimeout(() => {
                this.$router.push({
                  path: "notAudit"
                });
              }, 500);
            })
            .catch(err => {
              console.log(err);
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "取消输入"
          });
        });
    },
    //付款单审核
    PayAudit(){
      axios
        .get('ExamineCommunication',{
          key:  this.DocNo,
          DocType:  this.DocType
        }).then(res => {
          if(res.Data === '1'){
            this.$confirm(res.Message, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.ToExaminePay();
            }).catch(() => {
                this.$message({
                type: "info",
                message: "已取消"
              });
            });
          } else if(res.Data === '2') {
            this.$message({
              type: "warning",
              message: res.Message,
              duration:1500 
            });
          }else
            this.ToExaminePay();
        })
        .catch(err => {
          console.log(err);
        })
    },
    //付款单审核 操作
    ToExaminePay() {
      let DocNo = this.DocNo;
      let msg = this.Msg;
      this.checkMsg(); //审核提示
      this.$confirm(msg, {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
        .then(() => {
          axios
            .get("PayToExamine", {
              key: DocNo,
              type: 0 //0审核 1驳回
            })
            .then(res => {
              this.$message({
                type: "success",
                message: res,
                duration:800
              });
              setTimeout(() => {
                this.$router.push({
                  path: "notAudit"
                });
              }, 500);
            })
            .catch(err => {
              console.log(err);
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
          });
    },
    //内部流程图
    checkflow() {
      this.checkflowVisible = true;
      this.docViewloading = true;
      console.log(this.DocNo,'this.DocNo');
      console.log(this.DocType,'this.DocType');
      axios
        .get("checkFlow", {
          DocNo: this.DocNo, //单据编号
          DocType: this.DocType 
        })
        .then(res => {
          this.docView = res;
          this.docViewloading = false;
        })
        .catch(err => {
          console.log(err);
        });
    },
    //外部流程图
    checkflowRow(index, row) {
      this.checkflowRowVisible = true;
      let DocNo = row.DocNO;
      if (this.checkflowRowVisible == true) {
        if (row.DocStatus == "新建") {
          //如果是新建状态就直接给个提示
          this.checkflowRowVisible = false;
          this.$message({
            message: "新建状态未有流程图",
            type: "warning"
          });
        } else if (row.DocStatus == "无效") {
          //如果是无效状态也直接给个提示
          this.checkflowRowVisible = false;
          this.$message({
            message: "未找到相对应的流程图",
            type: "warning"
          });
        } else {
          //否则直接请求拿列表数据
          this.docViewloading = true;
          axios
            .get("checkFlow", {
              DocNo: DocNo, //单据编号
              DocType: row.Type //类型
            })
            .then(res => {
              this.docRowView = res;
              this.docViewloading = false;
            })
            .catch(err => {
              console.log(err);
            });
        }
      }
    },
    preview(scoped) {
      console.log(this.$refs["images"]);
      if (this.viewer) {
        this.viewer.destroy();
      }
      this.viewer = new this.$Viewer(this.$refs["images"], {
        url: "src",
        toolbar: {
          zoomIn: {
            show: 4,
            size: "large"
          },
          zoomOut: {
            show: 4,
            size: "large"
          },
          prev: {
            show: 4,
            size: "large"
          },
          next: {
            show: 4,
            size: "large"
          },
          rotateLeft: {
            show: 4,
            size: "large"
          },
          rotateRight: {
            show: 4,
            size: "large"
          }
        }
      });
      console.log(this.$refs["images"].childNodes[scoped.$index])     
      this.$refs["images"].childNodes[scoped.$index].childNodes[0].click()
    },
    //打开附件列表窗口
    openUploadDialog() {
      this.dialogUploadVisible = true;
      this.getUploadList();
    },
    //附件列表
    async getUploadList() {
      const res = await axios.get("UploadList",{key:this.DocNo,type:this.DocType,page:1,rows:5000})
      this.UploadList = res.rows;
    },
    //删除附件
    async DeleUpload(index,row) {
      const res = await axios.get('deleUpload',{key:row.ID})
      if (res.Success) {
          this.$message({
            message: res.Message,
            type: "success"
          })
          this.getUploadList();
      }else{
          this.$message({
            message: res.Message,
            type: "error"
          })
      }
    },
    //判断是否显示预览按钮
    isShowPreview (name) {
      var fileType = ['gif','jpg','png','JPG','PNG'];
      var temp = name.substring(name.lastIndexOf('.')+1);
      if(fileType.indexOf(temp) > -1) {
        return true
      }else {
        return false
      }
    },
    //开始上传附件
    update(e) { 
      for(var i=0 ;i < e.target.files.length;i++){
        let file = e.target.files[i];
        let param = new FormData(); //创建form对象
        param.append('fileData', file); //通过append向form对象添加数据
        param.append('chunk', '0'); //添加form表单中其他数据
        param.append('key', this.DocNo); //添加form表单中其他数据
        param.append('Type', this.DocType);
        console.log(param.get('file')); //FormData私有类对象，访问不到，可以通过get判断值是否传进去
        let config = {
          headers: {
            'Content-Type': 'multipart/form-data'
          }
        }; //添加请求头
        axios.post('Upload', param, config).then(res => {
          if(res.Success){
            this.$message({
              message: `上传成功`,
              type: 'success',
              duration: 800
            });
          }else{
            this.$message({
              message: res.Message,
              type: 'warning',
              duration: 2000
            });
          }
          this.getUploadList();
        }).catch(err => {
          console.log(err)
        })
      }
    },
  },
  mounted() {
    this.checkMsg(); //审核提示
    this.getList();
    console.log(this.$route.query,"this.$route.query")
    if (this.$route.query.showNum && this.$route.query.key) {
      console.log("mounted-handleEdit")
      this.handleEdit();
    }
  },
  computed:{
    Count1(){
      let sum = 0;
      for(let i of this.paymentsPrint){
        sum += Number(i.Money);
      }
      return sum;
    },
    Count2(){
      let sum = 0;
      for (let i of this.budgetList){
        sum += Number(i.Money)
      }
      return sum.toFixed(2);
    },
    Count3(){
      let sum = 0;
      for (let i of this.detail){
        sum += Number(i.IncomeMoney)
      }
      return sum.toFixed(2);
    },
    
  }
};
</script>

<style scoped lang="scss">
@import "../../common/css/index.css";
.toolbar h2 {
  line-height: 36px;
  margin: 0 10px 0 0;
}
.wInput {
  width: 200px !important;
  margin-right: 40px;
}

.wSelect {
  width: 200px !important;
  margin-right: 40px;
}

.wDate {
  width: 200px !important;
  margin-right: 40px;
}

.titles {
  background: #d2d2d2;
  height: 24px;
  padding: 10px 0;
  border-radius: 4px;
  color: #000;
}
.left-form{
  line-height:60px;
}
.left-form span.rvc{
  width:80px;
  display: inline-block;  
}
.left-form span.pay{
    display: inline-block;
    width: auto !important;
    margin-right: 20px;
}
.left-form .bankNum{
  width: initial;
  margin-left:5px;
  top:20px;
}
.rows {
  margin: 5px 0;
}
.rows .labels {
  width: 100px;
  display: inline-block;
}
.applied{
    margin-left: 0;
    height:36px;
    line-height:36px;
    border-radius:4px;
}
</style>
